1 #ifndef R_STR_UTIL_H 2 #define R_STR_UTIL_H 3 4 #define IS_NULLSTR(x) (!(x) || !*(x)) 5 #define IS_WHITECHAR(x) ((x) == ' ' || (x)=='\t' || (x) == '\n' || (x) == '\r') 6 #define IS_SEPARATOR(x) ((x) == ' ' || (x)=='\t' || (x) == '\n' || (x) == '\r' || (x) == ' '|| \ 7 (x) == ',' || (x) == ';' || (x) == ':' || (x) == '[' || (x) == ']' || \ 8 (x) == '(' || (x) == ')' || (x) == '{' || (x) == '}') 9 #define IS_HEXCHAR(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'a' && (x) <= 'f') || ((x) >= 'A' && (x) <= 'F')) 10 #define IS_PRINTABLE(x) ((x) >=' ' && (x) <= '~') 11 #define IS_DIGIT(x) ((x) >= '0' && (x) <= '9') 12 #define IS_OCTAL(x) ((x) >= '0' && (x) <= '7') 13 #define IS_WHITESPACE(x) ((x) == ' ' || (x) == '\t') 14 #define IS_UPPER(c) ((c) >= 'A' && (c) <= 'Z') 15 #define IS_LOWER(c) ((c) >= 'a' && (c) <= 'z') 16 17 #endif // R_STR_UTIL_H 18