summaryrefslogtreecommitdiff
path: root/include/al
diff options
context:
space:
mode:
Diffstat (limited to 'include/al')
-rw-r--r--include/al/str.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/al/str.h b/include/al/str.h
index 6640b0f..cb7c98f 100644
--- a/include/al/str.h
+++ b/include/al/str.h
@@ -70,6 +70,13 @@ static inline void al_str_to_lower(str *s)
}
}
+static inline void al_str_to_upper(str *s)
+{
+ for (u32 i = 0; i < s->length; i++) {
+ al_str_at(s, i) = al_toupper(al_str_at(s, i));
+ }
+}
+
// Returned c_str must be free'd by the user.
static inline char *al_str_to_c_str(str *s)
{
@@ -167,6 +174,7 @@ static inline bool al_str_tok(str *result, char delim)
return true;
}
+// djb2 hash.
static inline u32 al_str_hash(str *s)
{
u32 hash = 5381;