diff options
| author | gingerBill <bill@gingerbill.org> | 2018-05-26 23:12:55 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-05-26 23:12:55 +0100 |
| commit | c067b90403ab8493daa0bf5867b2bd92319feea5 (patch) | |
| tree | f8d8162cc7d0e937c925ed8b07831ffc0e9c75de /src/string.cpp | |
| parent | 5b6770f3d297c0639bdbe8b1b029616c16669165 (diff) | |
Add basic package support (no IR support yet)
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp index 16ba3c951..b63de5c76 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -94,6 +94,13 @@ String substring(String const &s, isize lo, isize hi) { } +char *alloc_cstring(gbAllocator a, String s) { + char *c_str = gb_alloc_array(a, char, s.len+1); + gb_memcopy(c_str, s.text, s.len); + c_str[s.len] = '\0'; + return c_str; +} + gb_inline bool str_eq_ignore_case(String const &a, String const &b) { |