diff options
Diffstat (limited to 'bruiser/luatablegen/W_Export_Entry_tablegen.c')
-rw-r--r-- | bruiser/luatablegen/W_Export_Entry_tablegen.c | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/bruiser/luatablegen/W_Export_Entry_tablegen.c b/bruiser/luatablegen/W_Export_Entry_tablegen.c deleted file mode 100644 index 68f40c2..0000000 --- a/bruiser/luatablegen/W_Export_Entry_tablegen.c +++ /dev/null @@ -1,138 +0,0 @@ - -// automatically generated by luatablegen -#include "../lua-5.3.4/src/lua.h" -#include "../lua-5.3.4/src/lauxlib.h" -#include "../lua-5.3.4/src/lualib.h" -#include <inttypes.h> -#include <stdbool.h> -#include "./W_Export_Entry_tablegen.h" - -#include "../wasm.h" - -static W_Export_Entry* convert_W_Export_Entry (lua_State* __ls, int index) { - W_Export_Entry* dummy = (W_Export_Entry*)lua_touserdata(__ls, index); - if (dummy == NULL) printf("W_Export_Entry:bad user data type.\n"); - return dummy; -} - -static W_Export_Entry* check_W_Export_Entry(lua_State* __ls, int index) { - W_Export_Entry* dummy; - luaL_checktype(__ls, index, LUA_TUSERDATA); - dummy = (W_Export_Entry*)luaL_checkudata(__ls, index, "W_Export_Entry"); - if (dummy == NULL) printf("W_Export_Entry:bad user data type.\n"); - return dummy; -} - -W_Export_Entry* push_W_Export_Entry(lua_State* __ls) { - lua_checkstack(__ls, 1); - W_Export_Entry* dummy = lua_newuserdata(__ls, sizeof(W_Export_Entry)); - luaL_getmetatable(__ls, "W_Export_Entry"); - lua_setmetatable(__ls, -2); - return dummy; -} - -int W_Export_Entry_push_args(lua_State* __ls, W_Export_Entry* _st) { - lua_checkstack(__ls, 4); - lua_pushinteger(__ls, _st->field_len); - lua_pushstring(__ls, _st->field_str); - lua_pushinteger(__ls, _st->kind); - lua_pushinteger(__ls, _st->index); - return 0; -} - -int new_W_Export_Entry(lua_State* __ls) { - lua_checkstack(__ls, 4); - varuint32 field_len = luaL_optinteger(__ls,-4,0); - char* field_str = lua_tostring(__ls,-3); - enum external_kind_t kind = luaL_optinteger(__ls,-2,0); - varuint32 index = luaL_optinteger(__ls,-1,0); - W_Export_Entry* dummy = push_W_Export_Entry(__ls); - dummy->field_len = field_len; - dummy->field_str = field_str; - dummy->kind = kind; - dummy->index = index; - return 1; -} - -static int getter_W_Export_Entry_field_len(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - lua_pop(__ls, -1); - lua_pushinteger(__ls, dummy->field_len); - return 1; -} -static int getter_W_Export_Entry_field_str(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - lua_pop(__ls, -1); - lua_pushstring(__ls, dummy->field_str); - return 1; -} -static int getter_W_Export_Entry_kind(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - lua_pop(__ls, -1); - lua_pushinteger(__ls, dummy->kind); - return 1; -} -static int getter_W_Export_Entry_index(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - lua_pop(__ls, -1); - lua_pushinteger(__ls, dummy->index); - return 1; -} - -static int setter_W_Export_Entry_field_len(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - dummy->field_len = luaL_checkinteger(__ls, 2); - lua_settop(__ls, 1); - return 1; -} -static int setter_W_Export_Entry_field_str(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - dummy->field_str = luaL_checkstring(__ls, 2); - lua_settop(__ls, 1); - return 1; -} -static int setter_W_Export_Entry_kind(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - dummy->kind = luaL_checkinteger(__ls, 2); - lua_settop(__ls, 1); - return 1; -} -static int setter_W_Export_Entry_index(lua_State* __ls) { - W_Export_Entry* dummy = check_W_Export_Entry(__ls, 1); - dummy->index = luaL_checkinteger(__ls, 2); - lua_settop(__ls, 1); - return 1; -} - -static const luaL_Reg W_Export_Entry_methods[] = { - {"new", new_W_Export_Entry}, - {"set_field_len", setter_W_Export_Entry_field_len}, - {"set_field_str", setter_W_Export_Entry_field_str}, - {"set_kind", setter_W_Export_Entry_kind}, - {"set_index", setter_W_Export_Entry_index}, - {"field_len", getter_W_Export_Entry_field_len}, - {"field_str", getter_W_Export_Entry_field_str}, - {"kind", getter_W_Export_Entry_kind}, - {"index", getter_W_Export_Entry_index}, - {0,0} -}; - -static const luaL_Reg W_Export_Entry_meta[] = { - {0, 0} -}; - -int W_Export_Entry_register(lua_State* __ls) { - luaL_openlib(__ls, "W_Export_Entry", W_Export_Entry_methods, 0); - luaL_newmetatable(__ls, "W_Export_Entry"); - luaL_openlib(__ls, 0, W_Export_Entry_meta, 0); - lua_pushliteral(__ls, "__index"); - lua_pushvalue(__ls, -3); - lua_rawset(__ls, -3); - lua_pushliteral(__ls, "__metatable"); - lua_pushvalue(__ls, -3); - lua_rawset(__ls, -3); - lua_pop(__ls, 1); -return 1; -} - - |