From 36dc1f859a13e428c441fc8f4f35550fe12ed72f Mon Sep 17 00:00:00 2001 From: nasr Date: Sun, 19 Apr 2026 18:38:22 +0200 Subject: feature(base): refactored the base library. removed some files etc and did stuff --- source/base/base_string.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'source/base/base_string.h') 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 //- string linked list implementation typedef struct string8_node string8_node; -struct string8_node +struct string8_node { string8 *next; string8 string; @@ -82,3 +82,37 @@ string8_appendc(string8 *buf, u8 c) } #endif /* BASE_STRING_H */ + +#ifdef BASE_IMPLEMENTATION + +internal b32 +is_alpha(u8 point) +{ + return ((point >= 'a' && point <= 'z') || (point >= 'A' && point <= 'Z') || (point == '_')); +} + +internal b32 +is_digit(u8 point) +{ + return (point >= '0' && point <= '9'); +} + +internal b32 +is_alpha_num(u8 point) +{ + return (is_alpha(point) || is_digit(point)); +} + +internal b32 is_whitespace(u8 point) +{ + return (point == '\n' || point == '\r' || point == ' ' || point == '\t'); +} + +internal b32 +is_slash(u8 point) +{ + return (point == '/' || point == '\\'); +} + + +#endif -- cgit v1.3