ctype.c 818 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * ctype.c
  3. */
  4. #include "lub/ctype.h"
  5. #include <ctype.h>
  6. /*--------------------------------------------------------- */
  7. bool_t lub_ctype_isdigit(char c)
  8. {
  9. unsigned char tmp = (unsigned char)c;
  10. return isdigit(tmp) ? BOOL_TRUE : BOOL_FALSE;
  11. }
  12. /*--------------------------------------------------------- */
  13. bool_t lub_ctype_isspace(char c)
  14. {
  15. unsigned char tmp = (unsigned char)c;
  16. return isspace(tmp) ? BOOL_TRUE : BOOL_FALSE;
  17. }
  18. /*--------------------------------------------------------- */
  19. char lub_ctype_tolower(char c)
  20. {
  21. unsigned char tmp = (unsigned char)c;
  22. return tolower(tmp);
  23. }
  24. /*--------------------------------------------------------- */
  25. char lub_ctype_toupper(char c)
  26. {
  27. unsigned char tmp = (unsigned char)c;
  28. return toupper(tmp);
  29. }
  30. /*--------------------------------------------------------- */