add sl_append_c_str
This commit is contained in:
parent
0e15f65dfb
commit
ce1c05c6e6
1 changed files with 10 additions and 0 deletions
10
slibs.h
10
slibs.h
|
@ -130,6 +130,16 @@ typedef sl_vec(char) sl_string;
|
||||||
(str).data; \
|
(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
|
// Pointers
|
||||||
|
|
||||||
#define sl_ptr(type) \
|
#define sl_ptr(type) \
|
||||||
|
|
Loading…
Add table
Reference in a new issue