diff options
Diffstat (limited to 'source/base/base_string.c')
| -rw-r--r-- | source/base/base_string.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/base/base_string.c b/source/base/base_string.c new file mode 100644 index 0000000..986fde5 --- /dev/null +++ b/source/base/base_string.c | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | internal b32 | ||
| 2 | is_alpha(u8 point) | ||
| 3 | { | ||
| 4 | return ((point >= 'a' && point <= 'z') || (point >= 'A' && point <= 'Z') || (point == '_')); | ||
| 5 | } | ||
| 6 | |||
| 7 | internal b32 | ||
| 8 | is_digit(u8 point) | ||
| 9 | { | ||
| 10 | return (point >= '0' && point <= '9'); | ||
| 11 | } | ||
| 12 | |||
| 13 | internal b32 | ||
| 14 | is_alpha_num(u8 point) | ||
| 15 | { | ||
| 16 | return (is_alpha(point) || is_digit(point)); | ||
| 17 | } | ||
| 18 | |||
| 19 | internal b32 is_whitespace(u8 point) | ||
| 20 | { | ||
| 21 | return (point == '\n' || point == '\r' || point == ' ' || point == '\t'); | ||
| 22 | } | ||
| 23 | |||
| 24 | internal b32 | ||
| 25 | is_slash(u8 point) | ||
| 26 | { | ||
| 27 | return (point == '/' || point == '\\'); | ||
| 28 | } | ||
| 29 | |||
| 30 | |||
