Rizin
unix-like reverse engineering framework and cli tools
rz_str_util.h
Go to the documentation of this file.
1 #ifndef RZ_STR_UTIL_H
2 #define RZ_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 // RZ_STR_UTIL_H