cctype 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. // -*- C++ -*-
  2. //===---------------------------- cctype ----------------------------------===//
  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_CCTYPE
  11. #define _LIBCPP_CCTYPE
  12. /*
  13. cctype synopsis
  14. namespace std
  15. {
  16. int isalnum(int c);
  17. int isalpha(int c);
  18. int isblank(int c); // C99
  19. int iscntrl(int c);
  20. int isdigit(int c);
  21. int isgraph(int c);
  22. int islower(int c);
  23. int isprint(int c);
  24. int ispunct(int c);
  25. int isspace(int c);
  26. int isupper(int c);
  27. int isxdigit(int c);
  28. int tolower(int c);
  29. int toupper(int c);
  30. } // std
  31. */
  32. #include <__config>
  33. #include <ctype.h>
  34. #if defined(_LIBCPP_MSVCRT)
  35. #include "support/win32/support.h"
  36. #include "support/win32/locale_win32.h"
  37. #endif // _LIBCPP_MSVCRT
  38. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  39. #pragma GCC system_header
  40. #endif
  41. _LIBCPP_BEGIN_NAMESPACE_STD
  42. #ifdef isalnum
  43. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}
  44. #undef isalnum
  45. inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);}
  46. #else // isalnum
  47. using ::isalnum;
  48. #endif // isalnum
  49. #ifdef isalpha
  50. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);}
  51. #undef isalpha
  52. inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);}
  53. #else // isalpha
  54. using ::isalpha;
  55. #endif // isalpha
  56. #ifdef isblank
  57. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);}
  58. #undef isblank
  59. inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);}
  60. #else // isblank
  61. using ::isblank;
  62. #endif // isblank
  63. #ifdef iscntrl
  64. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);}
  65. #undef iscntrl
  66. inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);}
  67. #else // iscntrl
  68. using ::iscntrl;
  69. #endif // iscntrl
  70. #ifdef isdigit
  71. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);}
  72. #undef isdigit
  73. inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);}
  74. #else // isdigit
  75. using ::isdigit;
  76. #endif // isdigit
  77. #ifdef isgraph
  78. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);}
  79. #undef isgraph
  80. inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);}
  81. #else // isgraph
  82. using ::isgraph;
  83. #endif // isgraph
  84. #ifdef islower
  85. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);}
  86. #undef islower
  87. inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);}
  88. #else // islower
  89. using ::islower;
  90. #endif // islower
  91. #ifdef isprint
  92. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);}
  93. #undef isprint
  94. inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);}
  95. #else // isprint
  96. using ::isprint;
  97. #endif // isprint
  98. #ifdef ispunct
  99. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);}
  100. #undef ispunct
  101. inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);}
  102. #else // ispunct
  103. using ::ispunct;
  104. #endif // ispunct
  105. #ifdef isspace
  106. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);}
  107. #undef isspace
  108. inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);}
  109. #else // isspace
  110. using ::isspace;
  111. #endif // isspace
  112. #ifdef isupper
  113. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);}
  114. #undef isupper
  115. inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);}
  116. #else // isupper
  117. using ::isupper;
  118. #endif // isupper
  119. #ifdef isxdigit
  120. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);}
  121. #undef isxdigit
  122. inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);}
  123. #else // isxdigit
  124. using ::isxdigit;
  125. #endif // isxdigit
  126. #ifdef tolower
  127. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);}
  128. #undef tolower
  129. inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);}
  130. #else // tolower
  131. using ::tolower;
  132. #endif // tolower
  133. #ifdef toupper
  134. inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);}
  135. #undef toupper
  136. inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);}
  137. #else // toupper
  138. using ::toupper;
  139. #endif // toupper
  140. _LIBCPP_END_NAMESPACE_STD
  141. #endif // _LIBCPP_CCTYPE