From d377b707b67b477ee5b22b08c714be34f3e82aa3 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Fri, 7 Apr 2023 13:59:47 -0500 Subject: switch to cargs and remove honeysuckle --- src/honeysuckle/hs_pushstring.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/honeysuckle/hs_pushstring.c (limited to 'src/honeysuckle/hs_pushstring.c') diff --git a/src/honeysuckle/hs_pushstring.c b/src/honeysuckle/hs_pushstring.c deleted file mode 100644 index f7da0d0..0000000 --- a/src/honeysuckle/hs_pushstring.c +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include "honeysuckle.h" - -void hs_vpushstring(lua_State *L, const char *format_string, va_list args) -{ - va_list args_; - va_copy(args_, args); - - int string_size = vsnprintf(NULL, 0, format_string, args_); - va_end(args_); - - char *string = malloc((string_size+1) * sizeof(char)); - if (string == NULL) { - lua_pushstring(L, "there was an error allocating memory for a string"); - lua_error(L); - } - - vsnprintf(string, string_size+1, format_string, args); - lua_pushstring(L, string); - free(string); -} - - -void hs_pushstring(lua_State *L, const char *format_string, ...) -{ - va_list args; - va_start(args, format_string); - hs_vpushstring(L, format_string, args); - va_end(args); -} -- cgit v1.2.1