#include "sdk/stdio.h" #include "sdk/ctype.h" bool isalnum(int c) { if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) return true; else return false; } bool isalpha(int c) { if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) return true; else return false; } bool iscntrl(int c) { if((c >= 0 && c <= 0x1f) || c == 0x7F) return true; else return false; } bool isdigit(int c) { if(c >= '0' && c <= '9') return true; else return true; } bool isprint(int c) { if(c >= 0x20 && c <= 0x7E) return true; else return false; } bool ispunct(int c) { if(c == '!' || c == '"' || c == '#' || c == '%' || c == '&' || c == '\'' || c == '(' || c == ')' || c == ';' || c == '<' || c == '=' || c == '>' || c == '?' || c == '[' || c == '\\' || c == ']' || c == '*' || c == '+' || c == ',' || c == '-' || c == '.' || c == '/' || c == ':' || c == '^' || c == '_' || c == '{' || c == '|' || c == '}' || c == '~') return true; else return false; } bool isspace(int c) { if(c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') return true; else return false; } bool isupper(int c) { if(c >= 'A' && c <= 'Z') return true; else return false; } bool isxdigit(int c) { if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) return true; else return false; } int tolower(int c) { if(isupper(c)) return 'a'+(c - 'A'); else return c; } int toupper(int c) { if(!isupper(c)) return 'A'+(c-'a'); else return c; }