diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-21 20:24:05 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-21 20:24:05 -0500 |
commit | fd6e5bcef96ac5e769470823e24b984c9394bfd5 (patch) | |
tree | a2c3c6fd304674ee6c407b58d6f5a1c2cf3aa499 /src/lua | |
parent | c407e5b904a69f3849831ba88074440707f0c6cd (diff) |
refactor: move honey_lua function definitions to common.h
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/honey_lua.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/lua/honey_lua.c b/src/lua/honey_lua.c deleted file mode 100644 index 36ca335..0000000 --- a/src/lua/honey_lua.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "honey_lua.h" - -void honey_lua_create_table(lua_State* L, - honey_lua_element* elements, - unsigned int n_elements) -{ - lua_createtable(L, 0, n_elements); - - for (int i=0; i<n_elements; i++) { - honey_lua_push_element(L, elements[i]); - lua_setfield(L, -2, elements[i].name); - } -} - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -void honey_lua_push_element(lua_State* L, honey_lua_element element) -{ - switch(element.type) { - case HONEY_INT: - lua_pushinteger(L, element.data.integer); - break; - - case HONEY_NUM: - lua_pushnumber(L, element.data.number); - break; - - case HONEY_STRING: - lua_pushstring(L, element.data.string); - break; - - case HONEY_FUNC: - lua_pushcfunction(L, element.data.function); - break; - - default: - // this should never happen - break; - } -} |