summaryrefslogtreecommitdiff
path: root/source/base/base_string.h
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2026-04-19 18:38:22 +0200
committernasr <nsrddyn@gmail.com>2026-04-19 18:38:22 +0200
commit36dc1f859a13e428c441fc8f4f35550fe12ed72f (patch)
treee8a98a43ccbd8b989427dc529dbdf37b2f942f9a /source/base/base_string.h
parent078e21a1feb811f9ef7797ce3ee5d2e8ffcccfce (diff)
feature(base): refactored the base library. removed some files etc and did stuff
Diffstat (limited to 'source/base/base_string.h')
-rw-r--r--source/base/base_string.h36
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
40typedef struct string8_node string8_node; 40typedef struct string8_node string8_node;
41struct string8_node 41struct 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
88internal b32
89is_alpha(u8 point)
90{
91 return ((point >= 'a' && point <= 'z') || (point >= 'A' && point <= 'Z') || (point == '_'));
92}
93
94internal b32
95is_digit(u8 point)
96{
97 return (point >= '0' && point <= '9');
98}
99
100internal b32
101is_alpha_num(u8 point)
102{
103 return (is_alpha(point) || is_digit(point));
104}
105
106internal b32 is_whitespace(u8 point)
107{
108 return (point == '\n' || point == '\r' || point == ' ' || point == '\t');
109}
110
111internal b32
112is_slash(u8 point)
113{
114 return (point == '/' || point == '\\');
115}
116
117
118#endif