diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-13 20:18:08 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-13 20:18:08 -0400 |
| commit | c455e7b67d2e55e6ed03e3449203d4e307f5a7dd (patch) | |
| tree | 27d9d4c77193f7aa1fe3a3c6fe5631d0ccfd59e2 /builtins/util.c | |
| parent | 816aa29b799132acb8c71d4968df6c4619fb2b1d (diff) | |
Rename builtins/ -> stdlib/
Diffstat (limited to 'builtins/util.c')
| -rw-r--r-- | builtins/util.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/builtins/util.c b/builtins/util.c deleted file mode 100644 index 7749b22c..00000000 --- a/builtins/util.c +++ /dev/null @@ -1,28 +0,0 @@ -// Built-in utility functions -#include <ctype.h> -#include <gc.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "text.h" -#include "util.h" - -public bool USE_COLOR; - -__attribute__((format(printf, 1, 2))) -public char *heap_strf(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - char *tmp = NULL; - int len = vasprintf(&tmp, fmt, args); - if (len < 0) return NULL; - va_end(args); - char *ret = GC_strndup(tmp, (size_t)len); - free(tmp); - return ret; -} - -// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
