ctype.cpp 1.9 KB

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