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 641B

123456789101112131415161718192021222324252627282930313233
  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. #define isprint(c) ((c) >= ' ' && (c) <= '~' )
  13. static inline unsigned char tolower(unsigned char c)
  14. {
  15. if (isupper(c))
  16. c -= 'A'-'a';
  17. return c;
  18. }
  19. static inline unsigned char toupper(unsigned char c)
  20. {
  21. if (islower(c))
  22. c -= 'a'-'A';
  23. return c;
  24. }
  25. extern int isspace ( int c );
  26. #endif /* _CTYPE_H */