ctype.h 284 B

123456789101112131415161718192021
  1. #ifndef BOOT_CTYPE_H
  2. #define BOOT_CTYPE_H
  3. static inline int isdigit(int ch)
  4. {
  5. return (ch >= '0') && (ch <= '9');
  6. }
  7. static inline int isxdigit(int ch)
  8. {
  9. if (isdigit(ch))
  10. return true;
  11. if ((ch >= 'a') && (ch <= 'f'))
  12. return true;
  13. return (ch >= 'A') && (ch <= 'F');
  14. }
  15. #endif