From 5bb783912ac384156b8abbe6e83a5a61da73881d Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 2 Mar 2023 00:20:38 -0600 Subject: fully remove honeysuckle and stop building cglm --- .../examples/table_processing/table_processing.c | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 libs/honeysuckle/examples/table_processing/table_processing.c (limited to 'libs/honeysuckle/examples/table_processing') diff --git a/libs/honeysuckle/examples/table_processing/table_processing.c b/libs/honeysuckle/examples/table_processing/table_processing.c deleted file mode 100644 index 64c1f01..0000000 --- a/libs/honeysuckle/examples/table_processing/table_processing.c +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include -#include - -struct settings -{ - bool debug; - int debug_level; - char *logfile; -} global_settings; - -void set_logfile(const char* filename, void *s) -{ - struct settings *settings = (struct settings *) s; - settings->logfile = malloc(sizeof(char) * strlen(filename)); - strcpy(settings->logfile, filename); -} - -int process(lua_State *L) -{ - int table_index; - hs_parse_args(L, hs_tbl(table_index)); - hs_process_table(L, table_index, - hs_process_bool("debug", - hs_pt_set_boolean, - &(global_settings.debug)), - hs_process_int("level", - hs_pt_set_integer, - &(global_settings.debug_level)), - hs_process_str("logfile", - set_logfile, - &global_settings)); - return 0; -} - -int main() -{ - lua_State *L = luaL_newstate(); - luaL_openlibs(L); - - lua_pushcfunction(L, process); - lua_setglobal(L, "configure"); - - global_settings.debug = false; - global_settings.debug_level = 0; - global_settings.logfile = "nil"; - - printf("settings: [ %d, %d, '%s' ]\n", - global_settings.debug, - global_settings.debug_level, - global_settings.logfile); - - luaL_dostring(L, "configure{debug=true, level=6, logfile='output.log'}"); - - printf("settings: [ %d, %d, '%s' ]\n", - global_settings.debug, - global_settings.debug_level, - global_settings.logfile); - return 0; -} -- cgit v1.2.1