ctype.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <ctype.h>
  7. extern "C" {
  8. char const _ctype_[1 + 256] = {
  9. 0,
  10. _C, _C, _C, _C, _C, _C, _C, _C,
  11. _C, _C | _S, _C | _S, _C | _S, _C | _S, _C | _S, _C, _C,
  12. _C, _C, _C, _C, _C, _C, _C, _C,
  13. _C, _C, _C, _C, _C, _C, _C, _C,
  14. (char)(_S | _B), _P, _P, _P, _P, _P, _P, _P,
  15. _P, _P, _P, _P, _P, _P, _P, _P,
  16. _N, _N, _N, _N, _N, _N, _N, _N,
  17. _N, _N, _P, _P, _P, _P, _P, _P,
  18. _P, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, _U,
  19. _U, _U, _U, _U, _U, _U, _U, _U,
  20. _U, _U, _U, _U, _U, _U, _U, _U,
  21. _U, _U, _U, _P, _P, _P, _P, _P,
  22. _P, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, _L,
  23. _L, _L, _L, _L, _L, _L, _L, _L,
  24. _L, _L, _L, _L, _L, _L, _L, _L,
  25. _L, _L, _L, _P, _P, _P, _P, _C
  26. };
  27. #undef isalnum
  28. int isalnum(int c)
  29. {
  30. return __inline_isalnum(c);
  31. }
  32. #undef isalpha
  33. int isalpha(int c)
  34. {
  35. return __inline_isalpha(c);
  36. }
  37. #undef iscntrl
  38. int iscntrl(int c)
  39. {
  40. return __inline_iscntrl(c);
  41. }
  42. #undef isdigit
  43. int isdigit(int c)
  44. {
  45. return __inline_isdigit(c);
  46. }
  47. #undef isxdigit
  48. int isxdigit(int c)
  49. {
  50. return __inline_isxdigit(c);
  51. }
  52. #undef isspace
  53. int isspace(int c)
  54. {
  55. return __inline_isspace(c);
  56. }
  57. #undef ispunct
  58. int ispunct(int c)
  59. {
  60. return __inline_ispunct(c);
  61. }
  62. #undef isprint
  63. int isprint(int c)
  64. {
  65. return __inline_isprint(c);
  66. }
  67. #undef isgraph
  68. int isgraph(int c)
  69. {
  70. return __inline_isgraph(c);
  71. }
  72. #undef isupper
  73. int isupper(int c)
  74. {
  75. return __inline_isupper(c);
  76. }
  77. #undef islower
  78. int islower(int c)
  79. {
  80. return __inline_islower(c);
  81. }
  82. #undef isascii
  83. int isascii(int c)
  84. {
  85. return __inline_isascii(c);
  86. }
  87. #undef isblank
  88. int isblank(int c)
  89. {
  90. return __inline_isblank(c);
  91. }
  92. #undef toascii
  93. int toascii(int c)
  94. {
  95. return __inline_toascii(c);
  96. }
  97. #undef tolower
  98. int tolower(int c)
  99. {
  100. return __inline_tolower(c);
  101. }
  102. #undef toupper
  103. int toupper(int c)
  104. {
  105. return __inline_toupper(c);
  106. }
  107. }