ctype.h 289 B

12345678910111213141516171819202122
  1. #ifndef BOOT_ISDIGIT_H
  2. #define BOOT_ISDIGIT_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