diff options
Diffstat (limited to 'source/base/base_string.h')
| -rw-r--r-- | source/base/base_string.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/source/base/base_string.h b/source/base/base_string.h index eb51e65..1f754f3 100644 --- a/source/base/base_string.h +++ b/source/base/base_string.h | |||
| @@ -38,7 +38,7 @@ struct string32 | |||
| 38 | 38 | ||
| 39 | //- string linked list implementation | 39 | //- string linked list implementation |
| 40 | typedef struct string8_node string8_node; | 40 | typedef struct string8_node string8_node; |
| 41 | struct string8_node | 41 | struct string8_node |
| 42 | { | 42 | { |
| 43 | string8 *next; | 43 | string8 *next; |
| 44 | string8 string; | 44 | string8 string; |
| @@ -82,3 +82,37 @@ string8_appendc(string8 *buf, u8 c) | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | #endif /* BASE_STRING_H */ | 84 | #endif /* BASE_STRING_H */ |
| 85 | |||
| 86 | #ifdef BASE_IMPLEMENTATION | ||
| 87 | |||
| 88 | internal b32 | ||
| 89 | is_alpha(u8 point) | ||
| 90 | { | ||
| 91 | return ((point >= 'a' && point <= 'z') || (point >= 'A' && point <= 'Z') || (point == '_')); | ||
| 92 | } | ||
| 93 | |||
| 94 | internal b32 | ||
| 95 | is_digit(u8 point) | ||
| 96 | { | ||
| 97 | return (point >= '0' && point <= '9'); | ||
| 98 | } | ||
| 99 | |||
| 100 | internal b32 | ||
| 101 | is_alpha_num(u8 point) | ||
| 102 | { | ||
| 103 | return (is_alpha(point) || is_digit(point)); | ||
| 104 | } | ||
| 105 | |||
| 106 | internal b32 is_whitespace(u8 point) | ||
| 107 | { | ||
| 108 | return (point == '\n' || point == '\r' || point == ' ' || point == '\t'); | ||
| 109 | } | ||
| 110 | |||
| 111 | internal b32 | ||
| 112 | is_slash(u8 point) | ||
| 113 | { | ||
| 114 | return (point == '/' || point == '\\'); | ||
| 115 | } | ||
| 116 | |||
| 117 | |||
| 118 | #endif | ||
