From dcb7a5389717c33f7fcfa67f5e2048cacc55d820 Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 4 Jan 2023 18:49:47 -0600 Subject: add kai_text_to_reals --- src/util/util.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/util/util.c') diff --git a/src/util/util.c b/src/util/util.c index c77b3f4..d3e8742 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -21,3 +21,22 @@ void *kai_expand_array(void **array, size_t *count, size_t element_size) *count = new_count; return new_element; } + + +int kai_text_to_reals(ka_real_t *dest, const char *str, size_t count) +{ + char *nptr = (char*) str; + char *end; + + int result = count; + + for (int i=0; i