General functionality without context

This commit is contained in:
gingerBill
2020-03-04 22:09:58 +00:00
parent 6151fdb324
commit e1da631d26
4 changed files with 218 additions and 24 deletions

View File

@@ -101,6 +101,14 @@ char *alloc_cstring(gbAllocator a, String s) {
return c_str;
}
char *cstring_duplicate(gbAllocator a, char const *s) {
isize len = gb_strlen(s);
char *c_str = gb_alloc_array(a, char, len+1);
gb_memmove(c_str, s, len);
c_str[len] = '\0';
return c_str;
}
gb_inline bool str_eq_ignore_case(String const &a, String const &b) {