You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ctype.h 594B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _CTYPE_H
  2. #define _CTYPE_H
  3. /** @file
  4. *
  5. * Character types
  6. */
  7. FILE_LICENCE ( GPL2_OR_LATER );
  8. #define isdigit(c) ((c) >= '0' && (c) <= '9')
  9. #define islower(c) ((c) >= 'a' && (c) <= 'z')
  10. #define isupper(c) ((c) >= 'A' && (c) <= 'Z')
  11. #define isxdigit(c) (isdigit(c) || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
  12. static inline unsigned char tolower(unsigned char c)
  13. {
  14. if (isupper(c))
  15. c -= 'A'-'a';
  16. return c;
  17. }
  18. static inline unsigned char toupper(unsigned char c)
  19. {
  20. if (islower(c))
  21. c -= 'a'-'A';
  22. return c;
  23. }
  24. extern int isspace ( int c );
  25. #endif /* _CTYPE_H */