diff options
author | bloodstalker <thabogre@gmail.com> | 2018-06-10 01:55:52 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-06-10 01:55:52 +0000 |
commit | c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0 (patch) | |
tree | c2b01bd58c150ce04771bd4da46b15d4411e217a /bruiser/luatablegen/W_Import_Section_Entry_tablegen.c | |
parent | the codegen is working now. the generated codes will not be part of the repo ... (diff) | |
download | mutator-c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0.tar.gz mutator-c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0.zip |
added the autogen files, should also fix travis
Diffstat (limited to 'bruiser/luatablegen/W_Import_Section_Entry_tablegen.c')
-rw-r--r-- | bruiser/luatablegen/W_Import_Section_Entry_tablegen.c | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/bruiser/luatablegen/W_Import_Section_Entry_tablegen.c b/bruiser/luatablegen/W_Import_Section_Entry_tablegen.c new file mode 100644 index 0000000..2f40fc0 --- /dev/null +++ b/bruiser/luatablegen/W_Import_Section_Entry_tablegen.c @@ -0,0 +1,182 @@ + +// 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> +#ifndef _W_Import_Section_Entry_H +#define _W_Import_Section_Entry_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Import_Section_Entry_tablegen.h" + +#include "../wasm.h" + +static W_Import_Section_Entry* convert_W_Import_Section_Entry (lua_State* __ls, int index) { + W_Import_Section_Entry* dummy = (W_Import_Section_Entry*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Import_Section_Entry:bad user data type.\n"); + return dummy; +} + +static W_Import_Section_Entry* check_W_Import_Section_Entry(lua_State* __ls, int index) { + W_Import_Section_Entry* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Import_Section_Entry*)luaL_checkudata(__ls, index, "W_Import_Section_Entry"); + if (dummy == NULL) printf("W_Import_Section_Entry:bad user data type.\n"); + return dummy; +} + +W_Import_Section_Entry* push_W_Import_Section_Entry(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Import_Section_Entry* dummy = lua_newuserdata(__ls, sizeof(W_Import_Section_Entry)); + luaL_getmetatable(__ls, "W_Import_Section_Entry"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Import_Section_Entry_push_args(lua_State* __ls, W_Import_Section_Entry* _st) { + lua_checkstack(__ls, 6); + lua_pushinteger(__ls, _st->module_length); + lua_pushstring(__ls, _st->module_str); + lua_pushinteger(__ls, _st->field_len); + lua_pushstring(__ls, _st->field_str); + lua_pushinteger(__ls, _st->kind); + lua_pushlightuserdata(__ls, _st->type); + return 0; +} + +int new_W_Import_Section_Entry(lua_State* __ls) { + lua_checkstack(__ls, 6); + varuint32 module_length = luaL_optinteger(__ls,-6,0); + char* module_str = lua_tostring(__ls,-5); + 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); + void* type = lua_touserdata(__ls,-1); + W_Import_Section_Entry* dummy = push_W_Import_Section_Entry(__ls); + dummy->module_length = module_length; + dummy->module_str = module_str; + dummy->field_len = field_len; + dummy->field_str = field_str; + dummy->kind = kind; + dummy->type = type; + return 1; +} + +static int getter_W_Import_Section_Entry_module_length(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->module_length); + return 1; +} +static int getter_W_Import_Section_Entry_module_str(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->module_str); + return 1; +} +static int getter_W_Import_Section_Entry_field_len(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->field_len); + return 1; +} +static int getter_W_Import_Section_Entry_field_str(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->field_str); + return 1; +} +static int getter_W_Import_Section_Entry_kind(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->kind); + return 1; +} +static int getter_W_Import_Section_Entry_type(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->type); + return 1; +} + +static int setter_W_Import_Section_Entry_module_length(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->module_length = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_Entry_module_str(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->module_str = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_Entry_field_len(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->field_len = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_Entry_field_str(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->field_str = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_Entry_kind(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->kind = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_Entry_type(lua_State* __ls) { + W_Import_Section_Entry* dummy = check_W_Import_Section_Entry(__ls, 1); + dummy->type = luaL_checkudata(__ls, 2, "W_Import_Section_Entry"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Import_Section_Entry_methods[] = { + {"new", new_W_Import_Section_Entry}, + {"set_module_length", setter_W_Import_Section_Entry_module_length}, + {"set_module_str", setter_W_Import_Section_Entry_module_str}, + {"set_field_len", setter_W_Import_Section_Entry_field_len}, + {"set_field_str", setter_W_Import_Section_Entry_field_str}, + {"set_kind", setter_W_Import_Section_Entry_kind}, + {"set_type", setter_W_Import_Section_Entry_type}, + {"module_length", getter_W_Import_Section_Entry_module_length}, + {"module_str", getter_W_Import_Section_Entry_module_str}, + {"field_len", getter_W_Import_Section_Entry_field_len}, + {"field_str", getter_W_Import_Section_Entry_field_str}, + {"kind", getter_W_Import_Section_Entry_kind}, + {"type", getter_W_Import_Section_Entry_type}, + {0,0} +}; + +static const luaL_Reg W_Import_Section_Entry_meta[] = { + {0, 0} +}; + +int W_Import_Section_Entry_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Import_Section_Entry", W_Import_Section_Entry_methods, 0); + luaL_newmetatable(__ls, "W_Import_Section_Entry"); + luaL_openlib(__ls, 0, W_Import_Section_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; +} + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + |