00001 #ifndef __LIB_CTYPE_H
00002
00003 #define __LIB_CTYPE_H
00004
00005 static inline int islower (int c) { return c >= 'a' && c <= 'z'; }
00006 static inline int isupper (int c) { return c >= 'A' && c <= 'Z'; }
00007 static inline int isalpha (int c) { return islower (c) || isupper (c); }
00008 static inline int isdigit (int c) { return c >= '0' && c <= '9'; }
00009 static inline int isalnum (int c) { return isalpha (c) || isdigit (c); }
00010 static inline int isxdigit (int c) {
00011 return isdigit (c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
00012 }
00013 static inline int isspace (int c) {
00014 return (c == ' ' || c == '\f' || c == '\n'
00015 || c == '\r' || c == '\t' || c == '\v');
00016 }
00017 static inline int isblank (int c) { return c == ' ' || c == '\t'; }
00018 static inline int isgraph (int c) { return c > 32 && c < 127; }
00019 static inline int isprint (int c) { return c >= 32 && c < 127; }
00020 static inline int iscntrl (int c) { return (c >= 0 && c < 32) || c == 127; }
00021 static inline int isascii (int c) { return c >= 0 && c < 128; }
00022 static inline int ispunct (int c) {
00023 return isprint (c) && !isalnum (c) && !isspace (c);
00024 }
00025
00026 static inline int tolower (int c) { return isupper (c) ? c - 'A' + 'a' : c; }
00027 static inline int toupper (int c) { return islower (c) ? c - 'a' + 'A' : c; }
00028
00029 #endif