add sl_append_c_str

This commit is contained in:
sam 2024-07-21 11:10:16 +12:00
parent 0e15f65dfb
commit ce1c05c6e6

10
slibs.h
View file

@ -130,6 +130,16 @@ typedef sl_vec(char) sl_string;
(str).data; \
})
void sl_append_c_str(sl_string* sl_str, const char* c_str);
#ifdef SL_IMPLEMENTATION
void sl_append_c_str(sl_string* sl_str, const char* c_str) {
for(int i = 0; i < strlen(c_str); i++) {
sl_vec_push(*sl_str, c_str[i]);
}
}
#endif
// Pointers
#define sl_ptr(type) \