Add string buffer macro and tests for Str8

This commit is contained in:
2024-10-08 23:57:55 +01:00
parent bfb4e87a1e
commit 8f10ac2916
2 changed files with 11 additions and 5 deletions

View File

@@ -14,6 +14,8 @@ struct str8 {
u8 *buf;
};
#define wapp_str8_buf(CAPACITY) ((Str8){.capacity = CAPACITY, .size = 0, .buf = (u8[CAPACITY]){0}})
Str8 wapp_str8_lit(char *str);
char wapp_str8_get(const Str8 *str, u64 index);
void wapp_str8_set(Str8 *str, u64 index, char c);