#include "common.h" /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ honey_result honey_format_string(char** string, char* format_string, ...) { honey_result res; va_list args, args_; va_start(args, format_string); va_copy(args_, args); int string_size = vsnprintf(NULL, 0, format_string, args_); va_end(args_); *string = malloc((string_size+1) * sizeof(char)); if (*string == NULL) res = HONEY_MEMORY_ALLOCATION_ERROR; else { vsnprintf(*string, string_size+1, format_string, args); res = HONEY_OK; } va_end(args); return res; } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ bool honey_lua_validate_types(lua_State* L, unsigned int n_types, ...) { va_list args; va_start(args, n_types); for (int i=0; iwindow, true); return 0; }