ctype.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _CTYPE_H
  2. #define _CTYPE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. int isalnum(int);
  8. int isalpha(int);
  9. int isblank(int);
  10. int iscntrl(int);
  11. int isdigit(int);
  12. int isgraph(int);
  13. int islower(int);
  14. int isprint(int);
  15. int ispunct(int);
  16. int isspace(int);
  17. int isupper(int);
  18. int isxdigit(int);
  19. int tolower(int);
  20. int toupper(int);
  21. #define isalpha(a) ((((unsigned)(a)|32)-'a') < 26)
  22. #define isdigit(a) (((unsigned)(a)-'0') < 10)
  23. #define islower(a) (((unsigned)(a)-'a') < 26)
  24. #define isupper(a) (((unsigned)(a)-'A') < 26)
  25. #define isprint(a) (((unsigned)(a)-0x20) < 0x5f)
  26. #define isgraph(a) (((unsigned)(a)-0x21) < 0x5e)
  27. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  28. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  29. || defined(_BSD_SOURCE)
  30. #define __NEED_locale_t
  31. #include <bits/alltypes.h>
  32. int isalnum_l(int, locale_t);
  33. int isalpha_l(int, locale_t);
  34. int isblank_l(int, locale_t);
  35. int iscntrl_l(int, locale_t);
  36. int isdigit_l(int, locale_t);
  37. int isgraph_l(int, locale_t);
  38. int islower_l(int, locale_t);
  39. int isprint_l(int, locale_t);
  40. int ispunct_l(int, locale_t);
  41. int isspace_l(int, locale_t);
  42. int isupper_l(int, locale_t);
  43. int isxdigit_l(int, locale_t);
  44. int tolower_l(int, locale_t);
  45. int toupper_l(int, locale_t);
  46. int isascii(int);
  47. int toascii(int);
  48. #define _tolower(a) ((a)|0x20)
  49. #define _toupper(a) ((a)&0x5f)
  50. #endif
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif