From 567d384b698151e287e31140709c93f1b92e6db4 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:29:27 +1000 Subject: loading joints and animations --- src/std/str.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/std/str.c') diff --git a/src/std/str.c b/src/std/str.c index 2aac15f..89c76a0 100644 --- a/src/std/str.c +++ b/src/std/str.c @@ -1,6 +1,7 @@ #include "str.h" #include #include +#include "log.h" #include "mem.h" Str8 Str8_create(u8* buf, size_t len) { return (Str8){ .buf = buf, .len = len }; } @@ -33,6 +34,15 @@ char* Str8_to_cstr(arena* a, Str8 s) { return (char*)dest; } +char* Clone_cstr(arena* a, const char* s) { + if (s == NULL) { + WARN("Tried to clone a NULL char*"); + return NULL; + } + Str8 st = Str8_cstr_view(s); + return Str8_to_cstr(a, st); +} + Str8 Str8_concat(arena* a, Str8 left, Str8 right) { size_t n_bytes = left.len + right.len + 1; -- cgit v1.2.3-70-g09d2