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 | |
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
56 files changed, 4506 insertions, 0 deletions
diff --git a/bruiser/lua-scripts/wasm.lua b/bruiser/lua-scripts/wasm.lua new file mode 100644 index 0000000..88588a6 --- /dev/null +++ b/bruiser/lua-scripts/wasm.lua @@ -0,0 +1,204 @@ +-- automatically generated by luatablegen +local wasm = {} + +setmetatable(init_expr_t, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(resizable_limit_t, {__call = + function(self, arg0, arg1, arg2) + local t = self.new(arg0, arg1, arg2) + return t + end + } +) + +setmetatable(global_type_t, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(table_type_t, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(memory_type_t, {__call = + function(self, arg0) + local t = self.new(arg0) + return t + end + } +) + +setmetatable(W_Type_Section_Entry, {__call = + function(self, arg0, arg1, arg2, arg3, arg4) + local t = self.new(arg0, arg1, arg2, arg3, arg4) + return t + end + } +) + +setmetatable(W_Type_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Import_Section_Entry, {__call = + function(self, arg0, arg1, arg2, arg3, arg4, arg5) + local t = self.new(arg0, arg1, arg2, arg3, arg4, arg5) + return t + end + } +) + +setmetatable(W_Import_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Function_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Table_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Memory_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Global_Entry, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Global_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Export_Entry, {__call = + function(self, arg0, arg1, arg2, arg3) + local t = self.new(arg0, arg1, arg2, arg3) + return t + end + } +) + +setmetatable(W_Export_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Start_Section, {__call = + function(self, arg0) + local t = self.new(arg0) + return t + end + } +) + +setmetatable(W_Elem_Segment, {__call = + function(self, arg0, arg1, arg2, arg3) + local t = self.new(arg0, arg1, arg2, arg3) + return t + end + } +) + +setmetatable(W_Element_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Local_Entry, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Function_Body, {__call = + function(self, arg0, arg1, arg2, arg3) + local t = self.new(arg0, arg1, arg2, arg3) + return t + end + } +) + +setmetatable(W_Code_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(W_Data_Segment, {__call = + function(self, arg0, arg1, arg2, arg3) + local t = self.new(arg0, arg1, arg2, arg3) + return t + end + } +) + +setmetatable(W_Data_Section, {__call = + function(self, arg0, arg1) + local t = self.new(arg0, arg1) + return t + end + } +) + +setmetatable(Wasm_Module, {__call = + function(self, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) + local t = self.new(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) + return t + end + } +) + +return wasm diff --git a/bruiser/luatablegen/W_Code_Section_tablegen.c b/bruiser/luatablegen/W_Code_Section_tablegen.c new file mode 100644 index 0000000..717af94 --- /dev/null +++ b/bruiser/luatablegen/W_Code_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Code_Section_H +#define _W_Code_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Code_Section_tablegen.h" + +#include "../wasm.h" + +static W_Code_Section* convert_W_Code_Section (lua_State* __ls, int index) { + W_Code_Section* dummy = (W_Code_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Code_Section:bad user data type.\n"); + return dummy; +} + +static W_Code_Section* check_W_Code_Section(lua_State* __ls, int index) { + W_Code_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Code_Section*)luaL_checkudata(__ls, index, "W_Code_Section"); + if (dummy == NULL) printf("W_Code_Section:bad user data type.\n"); + return dummy; +} + +W_Code_Section* push_W_Code_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Code_Section* dummy = lua_newuserdata(__ls, sizeof(W_Code_Section)); + luaL_getmetatable(__ls, "W_Code_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Code_Section_push_args(lua_State* __ls, W_Code_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->bodies); + return 0; +} + +int new_W_Code_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Function_Body** bodies = lua_touserdata(__ls,-1); + W_Code_Section* dummy = push_W_Code_Section(__ls); + dummy->count = count; + dummy->bodies = bodies; + return 1; +} + +static int getter_W_Code_Section_count(lua_State* __ls) { + W_Code_Section* dummy = check_W_Code_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Code_Section_bodies(lua_State* __ls) { + W_Code_Section* dummy = check_W_Code_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->bodies); + return 1; +} + +static int setter_W_Code_Section_count(lua_State* __ls) { + W_Code_Section* dummy = check_W_Code_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Code_Section_bodies(lua_State* __ls) { + W_Code_Section* dummy = check_W_Code_Section(__ls, 1); + dummy->bodies = luaL_checkudata(__ls, 2, "W_Code_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Code_Section_methods[] = { + {"new", new_W_Code_Section}, + {"set_count", setter_W_Code_Section_count}, + {"set_bodies", setter_W_Code_Section_bodies}, + {"count", getter_W_Code_Section_count}, + {"bodies", getter_W_Code_Section_bodies}, + {0,0} +}; + +static const luaL_Reg W_Code_Section_meta[] = { + {0, 0} +}; + +int W_Code_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Code_Section", W_Code_Section_methods, 0); + luaL_newmetatable(__ls, "W_Code_Section"); + luaL_openlib(__ls, 0, W_Code_Section_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 + + diff --git a/bruiser/luatablegen/W_Code_Section_tablegen.h b/bruiser/luatablegen/W_Code_Section_tablegen.h new file mode 100644 index 0000000..76026d3 --- /dev/null +++ b/bruiser/luatablegen/W_Code_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Code_Section_H +#define _W_Code_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Code_Section* convert_W_Code_Section (lua_State* __ls, int index); +static W_Code_Section* check_W_Code_Section(lua_State* __ls, int index); +W_Code_Section* push_W_Code_Section(lua_State* __ls); +int W_Code_Section_push_args(lua_State* __ls, W_Code_Section* _st); +int new_W_Code_Section(lua_State* __ls); +static int getter_W_Code_Section_count(lua_State* __ls); +static int getter_W_Code_Section_bodies(lua_State* __ls); +static int setter_W_Code_Section_count(lua_State* __ls); +static int setter_W_Code_Section_bodies(lua_State* __ls); +int W_Code_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Data_Section_tablegen.c b/bruiser/luatablegen/W_Data_Section_tablegen.c new file mode 100644 index 0000000..a1f78f5 --- /dev/null +++ b/bruiser/luatablegen/W_Data_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Data_Section_H +#define _W_Data_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Data_Section_tablegen.h" + +#include "../wasm.h" + +static W_Data_Section* convert_W_Data_Section (lua_State* __ls, int index) { + W_Data_Section* dummy = (W_Data_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Data_Section:bad user data type.\n"); + return dummy; +} + +static W_Data_Section* check_W_Data_Section(lua_State* __ls, int index) { + W_Data_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Data_Section*)luaL_checkudata(__ls, index, "W_Data_Section"); + if (dummy == NULL) printf("W_Data_Section:bad user data type.\n"); + return dummy; +} + +W_Data_Section* push_W_Data_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Data_Section* dummy = lua_newuserdata(__ls, sizeof(W_Data_Section)); + luaL_getmetatable(__ls, "W_Data_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Data_Section_push_args(lua_State* __ls, W_Data_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Data_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Data_Segment** entries = lua_touserdata(__ls,-1); + W_Data_Section* dummy = push_W_Data_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Data_Section_count(lua_State* __ls) { + W_Data_Section* dummy = check_W_Data_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Data_Section_entries(lua_State* __ls) { + W_Data_Section* dummy = check_W_Data_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Data_Section_count(lua_State* __ls) { + W_Data_Section* dummy = check_W_Data_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Data_Section_entries(lua_State* __ls) { + W_Data_Section* dummy = check_W_Data_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Data_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Data_Section_methods[] = { + {"new", new_W_Data_Section}, + {"set_count", setter_W_Data_Section_count}, + {"set_entries", setter_W_Data_Section_entries}, + {"count", getter_W_Data_Section_count}, + {"entries", getter_W_Data_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Data_Section_meta[] = { + {0, 0} +}; + +int W_Data_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Data_Section", W_Data_Section_methods, 0); + luaL_newmetatable(__ls, "W_Data_Section"); + luaL_openlib(__ls, 0, W_Data_Section_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 + + diff --git a/bruiser/luatablegen/W_Data_Section_tablegen.h b/bruiser/luatablegen/W_Data_Section_tablegen.h new file mode 100644 index 0000000..53276c0 --- /dev/null +++ b/bruiser/luatablegen/W_Data_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Data_Section_H +#define _W_Data_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Data_Section* convert_W_Data_Section (lua_State* __ls, int index); +static W_Data_Section* check_W_Data_Section(lua_State* __ls, int index); +W_Data_Section* push_W_Data_Section(lua_State* __ls); +int W_Data_Section_push_args(lua_State* __ls, W_Data_Section* _st); +int new_W_Data_Section(lua_State* __ls); +static int getter_W_Data_Section_count(lua_State* __ls); +static int getter_W_Data_Section_entries(lua_State* __ls); +static int setter_W_Data_Section_count(lua_State* __ls); +static int setter_W_Data_Section_entries(lua_State* __ls); +int W_Data_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Data_Segment_tablegen.c b/bruiser/luatablegen/W_Data_Segment_tablegen.c new file mode 100644 index 0000000..43d6df1 --- /dev/null +++ b/bruiser/luatablegen/W_Data_Segment_tablegen.c @@ -0,0 +1,148 @@ + +// 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_Data_Segment_H +#define _W_Data_Segment_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Data_Segment_tablegen.h" + +#include "../wasm.h" + +static W_Data_Segment* convert_W_Data_Segment (lua_State* __ls, int index) { + W_Data_Segment* dummy = (W_Data_Segment*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Data_Segment:bad user data type.\n"); + return dummy; +} + +static W_Data_Segment* check_W_Data_Segment(lua_State* __ls, int index) { + W_Data_Segment* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Data_Segment*)luaL_checkudata(__ls, index, "W_Data_Segment"); + if (dummy == NULL) printf("W_Data_Segment:bad user data type.\n"); + return dummy; +} + +W_Data_Segment* push_W_Data_Segment(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Data_Segment* dummy = lua_newuserdata(__ls, sizeof(W_Data_Segment)); + luaL_getmetatable(__ls, "W_Data_Segment"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Data_Segment_push_args(lua_State* __ls, W_Data_Segment* _st) { + lua_checkstack(__ls, 4); + lua_pushinteger(__ls, _st->index); + lua_pushlightuserdata(__ls, _st->offset); + lua_pushinteger(__ls, _st->size); + lua_pushstring(__ls, _st->data); + return 0; +} + +int new_W_Data_Segment(lua_State* __ls) { + lua_checkstack(__ls, 4); + varuint32 index = luaL_optinteger(__ls,-4,0); + init_expr_t* offset = lua_touserdata(__ls,-3); + varuint32 size = luaL_optinteger(__ls,-2,0); + char* data = lua_tostring(__ls,-1); + W_Data_Segment* dummy = push_W_Data_Segment(__ls); + dummy->index = index; + dummy->offset = offset; + dummy->size = size; + dummy->data = data; + return 1; +} + +static int getter_W_Data_Segment_index(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->index); + return 1; +} +static int getter_W_Data_Segment_offset(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->offset); + return 1; +} +static int getter_W_Data_Segment_size(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->size); + return 1; +} +static int getter_W_Data_Segment_data(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->data); + return 1; +} + +static int setter_W_Data_Segment_index(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + dummy->index = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Data_Segment_offset(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + dummy->offset = luaL_checkudata(__ls, 2, "W_Data_Segment"); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Data_Segment_size(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + dummy->size = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Data_Segment_data(lua_State* __ls) { + W_Data_Segment* dummy = check_W_Data_Segment(__ls, 1); + dummy->data = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Data_Segment_methods[] = { + {"new", new_W_Data_Segment}, + {"set_index", setter_W_Data_Segment_index}, + {"set_offset", setter_W_Data_Segment_offset}, + {"set_size", setter_W_Data_Segment_size}, + {"set_data", setter_W_Data_Segment_data}, + {"index", getter_W_Data_Segment_index}, + {"offset", getter_W_Data_Segment_offset}, + {"size", getter_W_Data_Segment_size}, + {"data", getter_W_Data_Segment_data}, + {0,0} +}; + +static const luaL_Reg W_Data_Segment_meta[] = { + {0, 0} +}; + +int W_Data_Segment_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Data_Segment", W_Data_Segment_methods, 0); + luaL_newmetatable(__ls, "W_Data_Segment"); + luaL_openlib(__ls, 0, W_Data_Segment_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 + + diff --git a/bruiser/luatablegen/W_Data_Segment_tablegen.h b/bruiser/luatablegen/W_Data_Segment_tablegen.h new file mode 100644 index 0000000..008cc15 --- /dev/null +++ b/bruiser/luatablegen/W_Data_Segment_tablegen.h @@ -0,0 +1,36 @@ + +// 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_Data_Segment_H +#define _W_Data_Segment_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Data_Segment* convert_W_Data_Segment (lua_State* __ls, int index); +static W_Data_Segment* check_W_Data_Segment(lua_State* __ls, int index); +W_Data_Segment* push_W_Data_Segment(lua_State* __ls); +int W_Data_Segment_push_args(lua_State* __ls, W_Data_Segment* _st); +int new_W_Data_Segment(lua_State* __ls); +static int getter_W_Data_Segment_index(lua_State* __ls); +static int getter_W_Data_Segment_offset(lua_State* __ls); +static int getter_W_Data_Segment_size(lua_State* __ls); +static int getter_W_Data_Segment_data(lua_State* __ls); +static int setter_W_Data_Segment_index(lua_State* __ls); +static int setter_W_Data_Segment_offset(lua_State* __ls); +static int setter_W_Data_Segment_size(lua_State* __ls); +static int setter_W_Data_Segment_data(lua_State* __ls); +int W_Data_Segment_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Elem_Segment_tablegen.c b/bruiser/luatablegen/W_Elem_Segment_tablegen.c new file mode 100644 index 0000000..0500f0d --- /dev/null +++ b/bruiser/luatablegen/W_Elem_Segment_tablegen.c @@ -0,0 +1,148 @@ + +// 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_Elem_Segment_H +#define _W_Elem_Segment_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Elem_Segment_tablegen.h" + +#include "../wasm.h" + +static W_Elem_Segment* convert_W_Elem_Segment (lua_State* __ls, int index) { + W_Elem_Segment* dummy = (W_Elem_Segment*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Elem_Segment:bad user data type.\n"); + return dummy; +} + +static W_Elem_Segment* check_W_Elem_Segment(lua_State* __ls, int index) { + W_Elem_Segment* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Elem_Segment*)luaL_checkudata(__ls, index, "W_Elem_Segment"); + if (dummy == NULL) printf("W_Elem_Segment:bad user data type.\n"); + return dummy; +} + +W_Elem_Segment* push_W_Elem_Segment(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Elem_Segment* dummy = lua_newuserdata(__ls, sizeof(W_Elem_Segment)); + luaL_getmetatable(__ls, "W_Elem_Segment"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Elem_Segment_push_args(lua_State* __ls, W_Elem_Segment* _st) { + lua_checkstack(__ls, 4); + lua_pushinteger(__ls, _st->index); + lua_pushlightuserdata(__ls, _st->offset); + lua_pushinteger(__ls, _st->num_length); + lua_pushinteger(__ls, _st->elems); + return 0; +} + +int new_W_Elem_Segment(lua_State* __ls) { + lua_checkstack(__ls, 4); + varuint32 index = luaL_optinteger(__ls,-4,0); + init_expr_t* offset = lua_touserdata(__ls,-3); + varuint32 num_length = luaL_optinteger(__ls,-2,0); + varuint32* elems = luaL_optinteger(__ls,-1,0); + W_Elem_Segment* dummy = push_W_Elem_Segment(__ls); + dummy->index = index; + dummy->offset = offset; + dummy->num_length = num_length; + dummy->elems = elems; + return 1; +} + +static int getter_W_Elem_Segment_index(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->index); + return 1; +} +static int getter_W_Elem_Segment_offset(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->offset); + return 1; +} +static int getter_W_Elem_Segment_num_length(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->num_length); + return 1; +} +static int getter_W_Elem_Segment_elems(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->elems); + return 1; +} + +static int setter_W_Elem_Segment_index(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + dummy->index = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Elem_Segment_offset(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + dummy->offset = luaL_checkudata(__ls, 2, "W_Elem_Segment"); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Elem_Segment_num_length(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + dummy->num_length = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Elem_Segment_elems(lua_State* __ls) { + W_Elem_Segment* dummy = check_W_Elem_Segment(__ls, 1); + dummy->elems = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Elem_Segment_methods[] = { + {"new", new_W_Elem_Segment}, + {"set_index", setter_W_Elem_Segment_index}, + {"set_offset", setter_W_Elem_Segment_offset}, + {"set_num_length", setter_W_Elem_Segment_num_length}, + {"set_elems", setter_W_Elem_Segment_elems}, + {"index", getter_W_Elem_Segment_index}, + {"offset", getter_W_Elem_Segment_offset}, + {"num_length", getter_W_Elem_Segment_num_length}, + {"elems", getter_W_Elem_Segment_elems}, + {0,0} +}; + +static const luaL_Reg W_Elem_Segment_meta[] = { + {0, 0} +}; + +int W_Elem_Segment_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Elem_Segment", W_Elem_Segment_methods, 0); + luaL_newmetatable(__ls, "W_Elem_Segment"); + luaL_openlib(__ls, 0, W_Elem_Segment_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 + + diff --git a/bruiser/luatablegen/W_Elem_Segment_tablegen.h b/bruiser/luatablegen/W_Elem_Segment_tablegen.h new file mode 100644 index 0000000..bde6475 --- /dev/null +++ b/bruiser/luatablegen/W_Elem_Segment_tablegen.h @@ -0,0 +1,36 @@ + +// 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_Elem_Segment_H +#define _W_Elem_Segment_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Elem_Segment* convert_W_Elem_Segment (lua_State* __ls, int index); +static W_Elem_Segment* check_W_Elem_Segment(lua_State* __ls, int index); +W_Elem_Segment* push_W_Elem_Segment(lua_State* __ls); +int W_Elem_Segment_push_args(lua_State* __ls, W_Elem_Segment* _st); +int new_W_Elem_Segment(lua_State* __ls); +static int getter_W_Elem_Segment_index(lua_State* __ls); +static int getter_W_Elem_Segment_offset(lua_State* __ls); +static int getter_W_Elem_Segment_num_length(lua_State* __ls); +static int getter_W_Elem_Segment_elems(lua_State* __ls); +static int setter_W_Elem_Segment_index(lua_State* __ls); +static int setter_W_Elem_Segment_offset(lua_State* __ls); +static int setter_W_Elem_Segment_num_length(lua_State* __ls); +static int setter_W_Elem_Segment_elems(lua_State* __ls); +int W_Elem_Segment_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Element_Section_tablegen.c b/bruiser/luatablegen/W_Element_Section_tablegen.c new file mode 100644 index 0000000..9e98ed7 --- /dev/null +++ b/bruiser/luatablegen/W_Element_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Element_Section_H +#define _W_Element_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Element_Section_tablegen.h" + +#include "../wasm.h" + +static W_Element_Section* convert_W_Element_Section (lua_State* __ls, int index) { + W_Element_Section* dummy = (W_Element_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Element_Section:bad user data type.\n"); + return dummy; +} + +static W_Element_Section* check_W_Element_Section(lua_State* __ls, int index) { + W_Element_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Element_Section*)luaL_checkudata(__ls, index, "W_Element_Section"); + if (dummy == NULL) printf("W_Element_Section:bad user data type.\n"); + return dummy; +} + +W_Element_Section* push_W_Element_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Element_Section* dummy = lua_newuserdata(__ls, sizeof(W_Element_Section)); + luaL_getmetatable(__ls, "W_Element_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Element_Section_push_args(lua_State* __ls, W_Element_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Element_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Elem_Segment** entries = lua_touserdata(__ls,-1); + W_Element_Section* dummy = push_W_Element_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Element_Section_count(lua_State* __ls) { + W_Element_Section* dummy = check_W_Element_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Element_Section_entries(lua_State* __ls) { + W_Element_Section* dummy = check_W_Element_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Element_Section_count(lua_State* __ls) { + W_Element_Section* dummy = check_W_Element_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Element_Section_entries(lua_State* __ls) { + W_Element_Section* dummy = check_W_Element_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Element_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Element_Section_methods[] = { + {"new", new_W_Element_Section}, + {"set_count", setter_W_Element_Section_count}, + {"set_entries", setter_W_Element_Section_entries}, + {"count", getter_W_Element_Section_count}, + {"entries", getter_W_Element_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Element_Section_meta[] = { + {0, 0} +}; + +int W_Element_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Element_Section", W_Element_Section_methods, 0); + luaL_newmetatable(__ls, "W_Element_Section"); + luaL_openlib(__ls, 0, W_Element_Section_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 + + diff --git a/bruiser/luatablegen/W_Element_Section_tablegen.h b/bruiser/luatablegen/W_Element_Section_tablegen.h new file mode 100644 index 0000000..9696217 --- /dev/null +++ b/bruiser/luatablegen/W_Element_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Element_Section_H +#define _W_Element_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Element_Section* convert_W_Element_Section (lua_State* __ls, int index); +static W_Element_Section* check_W_Element_Section(lua_State* __ls, int index); +W_Element_Section* push_W_Element_Section(lua_State* __ls); +int W_Element_Section_push_args(lua_State* __ls, W_Element_Section* _st); +int new_W_Element_Section(lua_State* __ls); +static int getter_W_Element_Section_count(lua_State* __ls); +static int getter_W_Element_Section_entries(lua_State* __ls); +static int setter_W_Element_Section_count(lua_State* __ls); +static int setter_W_Element_Section_entries(lua_State* __ls); +int W_Element_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Export_Entry_tablegen.c b/bruiser/luatablegen/W_Export_Entry_tablegen.c new file mode 100644 index 0000000..a9b5a73 --- /dev/null +++ b/bruiser/luatablegen/W_Export_Entry_tablegen.c @@ -0,0 +1,148 @@ + +// 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_Export_Entry_H +#define _W_Export_Entry_H +#ifdef __cplusplus +extern "C" { +#endif +#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; +} + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Export_Entry_tablegen.h b/bruiser/luatablegen/W_Export_Entry_tablegen.h new file mode 100644 index 0000000..00d0e00 --- /dev/null +++ b/bruiser/luatablegen/W_Export_Entry_tablegen.h @@ -0,0 +1,36 @@ + +// 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_Export_Entry_H +#define _W_Export_Entry_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Export_Entry* convert_W_Export_Entry (lua_State* __ls, int index); +static W_Export_Entry* check_W_Export_Entry(lua_State* __ls, int index); +W_Export_Entry* push_W_Export_Entry(lua_State* __ls); +int W_Export_Entry_push_args(lua_State* __ls, W_Export_Entry* _st); +int new_W_Export_Entry(lua_State* __ls); +static int getter_W_Export_Entry_field_len(lua_State* __ls); +static int getter_W_Export_Entry_field_str(lua_State* __ls); +static int getter_W_Export_Entry_kind(lua_State* __ls); +static int getter_W_Export_Entry_index(lua_State* __ls); +static int setter_W_Export_Entry_field_len(lua_State* __ls); +static int setter_W_Export_Entry_field_str(lua_State* __ls); +static int setter_W_Export_Entry_kind(lua_State* __ls); +static int setter_W_Export_Entry_index(lua_State* __ls); +int W_Export_Entry_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Export_Section_tablegen.c b/bruiser/luatablegen/W_Export_Section_tablegen.c new file mode 100644 index 0000000..fc4ffdf --- /dev/null +++ b/bruiser/luatablegen/W_Export_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Export_Section_H +#define _W_Export_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Export_Section_tablegen.h" + +#include "../wasm.h" + +static W_Export_Section* convert_W_Export_Section (lua_State* __ls, int index) { + W_Export_Section* dummy = (W_Export_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Export_Section:bad user data type.\n"); + return dummy; +} + +static W_Export_Section* check_W_Export_Section(lua_State* __ls, int index) { + W_Export_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Export_Section*)luaL_checkudata(__ls, index, "W_Export_Section"); + if (dummy == NULL) printf("W_Export_Section:bad user data type.\n"); + return dummy; +} + +W_Export_Section* push_W_Export_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Export_Section* dummy = lua_newuserdata(__ls, sizeof(W_Export_Section)); + luaL_getmetatable(__ls, "W_Export_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Export_Section_push_args(lua_State* __ls, W_Export_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Export_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Export_Entry** entries = lua_touserdata(__ls,-1); + W_Export_Section* dummy = push_W_Export_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Export_Section_count(lua_State* __ls) { + W_Export_Section* dummy = check_W_Export_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Export_Section_entries(lua_State* __ls) { + W_Export_Section* dummy = check_W_Export_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Export_Section_count(lua_State* __ls) { + W_Export_Section* dummy = check_W_Export_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Export_Section_entries(lua_State* __ls) { + W_Export_Section* dummy = check_W_Export_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Export_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Export_Section_methods[] = { + {"new", new_W_Export_Section}, + {"set_count", setter_W_Export_Section_count}, + {"set_entries", setter_W_Export_Section_entries}, + {"count", getter_W_Export_Section_count}, + {"entries", getter_W_Export_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Export_Section_meta[] = { + {0, 0} +}; + +int W_Export_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Export_Section", W_Export_Section_methods, 0); + luaL_newmetatable(__ls, "W_Export_Section"); + luaL_openlib(__ls, 0, W_Export_Section_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 + + diff --git a/bruiser/luatablegen/W_Export_Section_tablegen.h b/bruiser/luatablegen/W_Export_Section_tablegen.h new file mode 100644 index 0000000..4ab9968 --- /dev/null +++ b/bruiser/luatablegen/W_Export_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Export_Section_H +#define _W_Export_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Export_Section* convert_W_Export_Section (lua_State* __ls, int index); +static W_Export_Section* check_W_Export_Section(lua_State* __ls, int index); +W_Export_Section* push_W_Export_Section(lua_State* __ls); +int W_Export_Section_push_args(lua_State* __ls, W_Export_Section* _st); +int new_W_Export_Section(lua_State* __ls); +static int getter_W_Export_Section_count(lua_State* __ls); +static int getter_W_Export_Section_entries(lua_State* __ls); +static int setter_W_Export_Section_count(lua_State* __ls); +static int setter_W_Export_Section_entries(lua_State* __ls); +int W_Export_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Function_Body_tablegen.c b/bruiser/luatablegen/W_Function_Body_tablegen.c new file mode 100644 index 0000000..eb93f21 --- /dev/null +++ b/bruiser/luatablegen/W_Function_Body_tablegen.c @@ -0,0 +1,148 @@ + +// 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_Function_Body_H +#define _W_Function_Body_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Function_Body_tablegen.h" + +#include "../wasm.h" + +static W_Function_Body* convert_W_Function_Body (lua_State* __ls, int index) { + W_Function_Body* dummy = (W_Function_Body*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Function_Body:bad user data type.\n"); + return dummy; +} + +static W_Function_Body* check_W_Function_Body(lua_State* __ls, int index) { + W_Function_Body* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Function_Body*)luaL_checkudata(__ls, index, "W_Function_Body"); + if (dummy == NULL) printf("W_Function_Body:bad user data type.\n"); + return dummy; +} + +W_Function_Body* push_W_Function_Body(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Function_Body* dummy = lua_newuserdata(__ls, sizeof(W_Function_Body)); + luaL_getmetatable(__ls, "W_Function_Body"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Function_Body_push_args(lua_State* __ls, W_Function_Body* _st) { + lua_checkstack(__ls, 4); + lua_pushinteger(__ls, _st->body_size); + lua_pushinteger(__ls, _st->local_count); + lua_pushlightuserdata(__ls, _st->locals); + lua_pushstring(__ls, _st->code); + return 0; +} + +int new_W_Function_Body(lua_State* __ls) { + lua_checkstack(__ls, 4); + varuint32 body_size = luaL_optinteger(__ls,-4,0); + varuint32 local_count = luaL_optinteger(__ls,-3,0); + W_Local_Entry** locals = lua_touserdata(__ls,-2); + char* code = lua_tostring(__ls,-1); + W_Function_Body* dummy = push_W_Function_Body(__ls); + dummy->body_size = body_size; + dummy->local_count = local_count; + dummy->locals = locals; + dummy->code = code; + return 1; +} + +static int getter_W_Function_Body_body_size(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->body_size); + return 1; +} +static int getter_W_Function_Body_local_count(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->local_count); + return 1; +} +static int getter_W_Function_Body_locals(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->locals); + return 1; +} +static int getter_W_Function_Body_code(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->code); + return 1; +} + +static int setter_W_Function_Body_body_size(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + dummy->body_size = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Function_Body_local_count(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + dummy->local_count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Function_Body_locals(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + dummy->locals = luaL_checkudata(__ls, 2, "W_Function_Body"); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Function_Body_code(lua_State* __ls) { + W_Function_Body* dummy = check_W_Function_Body(__ls, 1); + dummy->code = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Function_Body_methods[] = { + {"new", new_W_Function_Body}, + {"set_body_size", setter_W_Function_Body_body_size}, + {"set_local_count", setter_W_Function_Body_local_count}, + {"set_locals", setter_W_Function_Body_locals}, + {"set_code", setter_W_Function_Body_code}, + {"body_size", getter_W_Function_Body_body_size}, + {"local_count", getter_W_Function_Body_local_count}, + {"locals", getter_W_Function_Body_locals}, + {"code", getter_W_Function_Body_code}, + {0,0} +}; + +static const luaL_Reg W_Function_Body_meta[] = { + {0, 0} +}; + +int W_Function_Body_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Function_Body", W_Function_Body_methods, 0); + luaL_newmetatable(__ls, "W_Function_Body"); + luaL_openlib(__ls, 0, W_Function_Body_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 + + diff --git a/bruiser/luatablegen/W_Function_Body_tablegen.h b/bruiser/luatablegen/W_Function_Body_tablegen.h new file mode 100644 index 0000000..2dcfc65 --- /dev/null +++ b/bruiser/luatablegen/W_Function_Body_tablegen.h @@ -0,0 +1,36 @@ + +// 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_Function_Body_H +#define _W_Function_Body_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Function_Body* convert_W_Function_Body (lua_State* __ls, int index); +static W_Function_Body* check_W_Function_Body(lua_State* __ls, int index); +W_Function_Body* push_W_Function_Body(lua_State* __ls); +int W_Function_Body_push_args(lua_State* __ls, W_Function_Body* _st); +int new_W_Function_Body(lua_State* __ls); +static int getter_W_Function_Body_body_size(lua_State* __ls); +static int getter_W_Function_Body_local_count(lua_State* __ls); +static int getter_W_Function_Body_locals(lua_State* __ls); +static int getter_W_Function_Body_code(lua_State* __ls); +static int setter_W_Function_Body_body_size(lua_State* __ls); +static int setter_W_Function_Body_local_count(lua_State* __ls); +static int setter_W_Function_Body_locals(lua_State* __ls); +static int setter_W_Function_Body_code(lua_State* __ls); +int W_Function_Body_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Function_Section_tablegen.c b/bruiser/luatablegen/W_Function_Section_tablegen.c new file mode 100644 index 0000000..9b83937 --- /dev/null +++ b/bruiser/luatablegen/W_Function_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Function_Section_H +#define _W_Function_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Function_Section_tablegen.h" + +#include "../wasm.h" + +static W_Function_Section* convert_W_Function_Section (lua_State* __ls, int index) { + W_Function_Section* dummy = (W_Function_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Function_Section:bad user data type.\n"); + return dummy; +} + +static W_Function_Section* check_W_Function_Section(lua_State* __ls, int index) { + W_Function_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Function_Section*)luaL_checkudata(__ls, index, "W_Function_Section"); + if (dummy == NULL) printf("W_Function_Section:bad user data type.\n"); + return dummy; +} + +W_Function_Section* push_W_Function_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Function_Section* dummy = lua_newuserdata(__ls, sizeof(W_Function_Section)); + luaL_getmetatable(__ls, "W_Function_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Function_Section_push_args(lua_State* __ls, W_Function_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->types); + return 0; +} + +int new_W_Function_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + varuint32* types = lua_touserdata(__ls,-1); + W_Function_Section* dummy = push_W_Function_Section(__ls); + dummy->count = count; + dummy->types = types; + return 1; +} + +static int getter_W_Function_Section_count(lua_State* __ls) { + W_Function_Section* dummy = check_W_Function_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Function_Section_types(lua_State* __ls) { + W_Function_Section* dummy = check_W_Function_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->types); + return 1; +} + +static int setter_W_Function_Section_count(lua_State* __ls) { + W_Function_Section* dummy = check_W_Function_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Function_Section_types(lua_State* __ls) { + W_Function_Section* dummy = check_W_Function_Section(__ls, 1); + dummy->types = luaL_checkudata(__ls, 2, "W_Function_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Function_Section_methods[] = { + {"new", new_W_Function_Section}, + {"set_count", setter_W_Function_Section_count}, + {"set_types", setter_W_Function_Section_types}, + {"count", getter_W_Function_Section_count}, + {"types", getter_W_Function_Section_types}, + {0,0} +}; + +static const luaL_Reg W_Function_Section_meta[] = { + {0, 0} +}; + +int W_Function_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Function_Section", W_Function_Section_methods, 0); + luaL_newmetatable(__ls, "W_Function_Section"); + luaL_openlib(__ls, 0, W_Function_Section_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 + + diff --git a/bruiser/luatablegen/W_Function_Section_tablegen.h b/bruiser/luatablegen/W_Function_Section_tablegen.h new file mode 100644 index 0000000..bd53df6 --- /dev/null +++ b/bruiser/luatablegen/W_Function_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Function_Section_H +#define _W_Function_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Function_Section* convert_W_Function_Section (lua_State* __ls, int index); +static W_Function_Section* check_W_Function_Section(lua_State* __ls, int index); +W_Function_Section* push_W_Function_Section(lua_State* __ls); +int W_Function_Section_push_args(lua_State* __ls, W_Function_Section* _st); +int new_W_Function_Section(lua_State* __ls); +static int getter_W_Function_Section_count(lua_State* __ls); +static int getter_W_Function_Section_types(lua_State* __ls); +static int setter_W_Function_Section_count(lua_State* __ls); +static int setter_W_Function_Section_types(lua_State* __ls); +int W_Function_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Global_Entry_tablegen.c b/bruiser/luatablegen/W_Global_Entry_tablegen.c new file mode 100644 index 0000000..9021820 --- /dev/null +++ b/bruiser/luatablegen/W_Global_Entry_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Global_Entry_H +#define _W_Global_Entry_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Global_Entry_tablegen.h" + +#include "../wasm.h" + +static W_Global_Entry* convert_W_Global_Entry (lua_State* __ls, int index) { + W_Global_Entry* dummy = (W_Global_Entry*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Global_Entry:bad user data type.\n"); + return dummy; +} + +static W_Global_Entry* check_W_Global_Entry(lua_State* __ls, int index) { + W_Global_Entry* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Global_Entry*)luaL_checkudata(__ls, index, "W_Global_Entry"); + if (dummy == NULL) printf("W_Global_Entry:bad user data type.\n"); + return dummy; +} + +W_Global_Entry* push_W_Global_Entry(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Global_Entry* dummy = lua_newuserdata(__ls, sizeof(W_Global_Entry)); + luaL_getmetatable(__ls, "W_Global_Entry"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Global_Entry_push_args(lua_State* __ls, W_Global_Entry* _st) { + lua_checkstack(__ls, 2); + lua_pushlightuserdata(__ls, _st->type); + lua_pushlightuserdata(__ls, _st->init); + return 0; +} + +int new_W_Global_Entry(lua_State* __ls) { + lua_checkstack(__ls, 2); + global_type_t* type = lua_touserdata(__ls,-2); + init_expr_t* init = lua_touserdata(__ls,-1); + W_Global_Entry* dummy = push_W_Global_Entry(__ls); + dummy->type = type; + dummy->init = init; + return 1; +} + +static int getter_W_Global_Entry_type(lua_State* __ls) { + W_Global_Entry* dummy = check_W_Global_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->type); + return 1; +} +static int getter_W_Global_Entry_init(lua_State* __ls) { + W_Global_Entry* dummy = check_W_Global_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->init); + return 1; +} + +static int setter_W_Global_Entry_type(lua_State* __ls) { + W_Global_Entry* dummy = check_W_Global_Entry(__ls, 1); + dummy->type = luaL_checkudata(__ls, 2, "W_Global_Entry"); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Global_Entry_init(lua_State* __ls) { + W_Global_Entry* dummy = check_W_Global_Entry(__ls, 1); + dummy->init = luaL_checkudata(__ls, 2, "W_Global_Entry"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Global_Entry_methods[] = { + {"new", new_W_Global_Entry}, + {"set_type", setter_W_Global_Entry_type}, + {"set_init", setter_W_Global_Entry_init}, + {"type", getter_W_Global_Entry_type}, + {"init", getter_W_Global_Entry_init}, + {0,0} +}; + +static const luaL_Reg W_Global_Entry_meta[] = { + {0, 0} +}; + +int W_Global_Entry_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Global_Entry", W_Global_Entry_methods, 0); + luaL_newmetatable(__ls, "W_Global_Entry"); + luaL_openlib(__ls, 0, W_Global_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 + + diff --git a/bruiser/luatablegen/W_Global_Entry_tablegen.h b/bruiser/luatablegen/W_Global_Entry_tablegen.h new file mode 100644 index 0000000..80a9afa --- /dev/null +++ b/bruiser/luatablegen/W_Global_Entry_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Global_Entry_H +#define _W_Global_Entry_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Global_Entry* convert_W_Global_Entry (lua_State* __ls, int index); +static W_Global_Entry* check_W_Global_Entry(lua_State* __ls, int index); +W_Global_Entry* push_W_Global_Entry(lua_State* __ls); +int W_Global_Entry_push_args(lua_State* __ls, W_Global_Entry* _st); +int new_W_Global_Entry(lua_State* __ls); +static int getter_W_Global_Entry_type(lua_State* __ls); +static int getter_W_Global_Entry_init(lua_State* __ls); +static int setter_W_Global_Entry_type(lua_State* __ls); +static int setter_W_Global_Entry_init(lua_State* __ls); +int W_Global_Entry_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Global_Section_tablegen.c b/bruiser/luatablegen/W_Global_Section_tablegen.c new file mode 100644 index 0000000..cb3195c --- /dev/null +++ b/bruiser/luatablegen/W_Global_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Global_Section_H +#define _W_Global_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Global_Section_tablegen.h" + +#include "../wasm.h" + +static W_Global_Section* convert_W_Global_Section (lua_State* __ls, int index) { + W_Global_Section* dummy = (W_Global_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Global_Section:bad user data type.\n"); + return dummy; +} + +static W_Global_Section* check_W_Global_Section(lua_State* __ls, int index) { + W_Global_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Global_Section*)luaL_checkudata(__ls, index, "W_Global_Section"); + if (dummy == NULL) printf("W_Global_Section:bad user data type.\n"); + return dummy; +} + +W_Global_Section* push_W_Global_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Global_Section* dummy = lua_newuserdata(__ls, sizeof(W_Global_Section)); + luaL_getmetatable(__ls, "W_Global_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Global_Section_push_args(lua_State* __ls, W_Global_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->globals); + return 0; +} + +int new_W_Global_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Global_Entry** globals = lua_touserdata(__ls,-1); + W_Global_Section* dummy = push_W_Global_Section(__ls); + dummy->count = count; + dummy->globals = globals; + return 1; +} + +static int getter_W_Global_Section_count(lua_State* __ls) { + W_Global_Section* dummy = check_W_Global_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Global_Section_globals(lua_State* __ls) { + W_Global_Section* dummy = check_W_Global_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->globals); + return 1; +} + +static int setter_W_Global_Section_count(lua_State* __ls) { + W_Global_Section* dummy = check_W_Global_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Global_Section_globals(lua_State* __ls) { + W_Global_Section* dummy = check_W_Global_Section(__ls, 1); + dummy->globals = luaL_checkudata(__ls, 2, "W_Global_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Global_Section_methods[] = { + {"new", new_W_Global_Section}, + {"set_count", setter_W_Global_Section_count}, + {"set_globals", setter_W_Global_Section_globals}, + {"count", getter_W_Global_Section_count}, + {"globals", getter_W_Global_Section_globals}, + {0,0} +}; + +static const luaL_Reg W_Global_Section_meta[] = { + {0, 0} +}; + +int W_Global_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Global_Section", W_Global_Section_methods, 0); + luaL_newmetatable(__ls, "W_Global_Section"); + luaL_openlib(__ls, 0, W_Global_Section_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 + + diff --git a/bruiser/luatablegen/W_Global_Section_tablegen.h b/bruiser/luatablegen/W_Global_Section_tablegen.h new file mode 100644 index 0000000..c58ae62 --- /dev/null +++ b/bruiser/luatablegen/W_Global_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Global_Section_H +#define _W_Global_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Global_Section* convert_W_Global_Section (lua_State* __ls, int index); +static W_Global_Section* check_W_Global_Section(lua_State* __ls, int index); +W_Global_Section* push_W_Global_Section(lua_State* __ls); +int W_Global_Section_push_args(lua_State* __ls, W_Global_Section* _st); +int new_W_Global_Section(lua_State* __ls); +static int getter_W_Global_Section_count(lua_State* __ls); +static int getter_W_Global_Section_globals(lua_State* __ls); +static int setter_W_Global_Section_count(lua_State* __ls); +static int setter_W_Global_Section_globals(lua_State* __ls); +int W_Global_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + 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 + + diff --git a/bruiser/luatablegen/W_Import_Section_Entry_tablegen.h b/bruiser/luatablegen/W_Import_Section_Entry_tablegen.h new file mode 100644 index 0000000..db2bddc --- /dev/null +++ b/bruiser/luatablegen/W_Import_Section_Entry_tablegen.h @@ -0,0 +1,40 @@ + +// 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 "../wasm.h" + +static W_Import_Section_Entry* convert_W_Import_Section_Entry (lua_State* __ls, int index); +static W_Import_Section_Entry* check_W_Import_Section_Entry(lua_State* __ls, int index); +W_Import_Section_Entry* push_W_Import_Section_Entry(lua_State* __ls); +int W_Import_Section_Entry_push_args(lua_State* __ls, W_Import_Section_Entry* _st); +int new_W_Import_Section_Entry(lua_State* __ls); +static int getter_W_Import_Section_Entry_module_length(lua_State* __ls); +static int getter_W_Import_Section_Entry_module_str(lua_State* __ls); +static int getter_W_Import_Section_Entry_field_len(lua_State* __ls); +static int getter_W_Import_Section_Entry_field_str(lua_State* __ls); +static int getter_W_Import_Section_Entry_kind(lua_State* __ls); +static int getter_W_Import_Section_Entry_type(lua_State* __ls); +static int setter_W_Import_Section_Entry_module_length(lua_State* __ls); +static int setter_W_Import_Section_Entry_module_str(lua_State* __ls); +static int setter_W_Import_Section_Entry_field_len(lua_State* __ls); +static int setter_W_Import_Section_Entry_field_str(lua_State* __ls); +static int setter_W_Import_Section_Entry_kind(lua_State* __ls); +static int setter_W_Import_Section_Entry_type(lua_State* __ls); +int W_Import_Section_Entry_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Import_Section_tablegen.c b/bruiser/luatablegen/W_Import_Section_tablegen.c new file mode 100644 index 0000000..88354f0 --- /dev/null +++ b/bruiser/luatablegen/W_Import_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_H +#define _W_Import_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Import_Section_tablegen.h" + +#include "../wasm.h" + +static W_Import_Section* convert_W_Import_Section (lua_State* __ls, int index) { + W_Import_Section* dummy = (W_Import_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Import_Section:bad user data type.\n"); + return dummy; +} + +static W_Import_Section* check_W_Import_Section(lua_State* __ls, int index) { + W_Import_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Import_Section*)luaL_checkudata(__ls, index, "W_Import_Section"); + if (dummy == NULL) printf("W_Import_Section:bad user data type.\n"); + return dummy; +} + +W_Import_Section* push_W_Import_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Import_Section* dummy = lua_newuserdata(__ls, sizeof(W_Import_Section)); + luaL_getmetatable(__ls, "W_Import_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Import_Section_push_args(lua_State* __ls, W_Import_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Import_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Import_Section** entries = lua_touserdata(__ls,-1); + W_Import_Section* dummy = push_W_Import_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Import_Section_count(lua_State* __ls) { + W_Import_Section* dummy = check_W_Import_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Import_Section_entries(lua_State* __ls) { + W_Import_Section* dummy = check_W_Import_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Import_Section_count(lua_State* __ls) { + W_Import_Section* dummy = check_W_Import_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Import_Section_entries(lua_State* __ls) { + W_Import_Section* dummy = check_W_Import_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Import_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Import_Section_methods[] = { + {"new", new_W_Import_Section}, + {"set_count", setter_W_Import_Section_count}, + {"set_entries", setter_W_Import_Section_entries}, + {"count", getter_W_Import_Section_count}, + {"entries", getter_W_Import_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Import_Section_meta[] = { + {0, 0} +}; + +int W_Import_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Import_Section", W_Import_Section_methods, 0); + luaL_newmetatable(__ls, "W_Import_Section"); + luaL_openlib(__ls, 0, W_Import_Section_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 + + diff --git a/bruiser/luatablegen/W_Import_Section_tablegen.h b/bruiser/luatablegen/W_Import_Section_tablegen.h new file mode 100644 index 0000000..2dd6799 --- /dev/null +++ b/bruiser/luatablegen/W_Import_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_H +#define _W_Import_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Import_Section* convert_W_Import_Section (lua_State* __ls, int index); +static W_Import_Section* check_W_Import_Section(lua_State* __ls, int index); +W_Import_Section* push_W_Import_Section(lua_State* __ls); +int W_Import_Section_push_args(lua_State* __ls, W_Import_Section* _st); +int new_W_Import_Section(lua_State* __ls); +static int getter_W_Import_Section_count(lua_State* __ls); +static int getter_W_Import_Section_entries(lua_State* __ls); +static int setter_W_Import_Section_count(lua_State* __ls); +static int setter_W_Import_Section_entries(lua_State* __ls); +int W_Import_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Local_Entry_tablegen.c b/bruiser/luatablegen/W_Local_Entry_tablegen.c new file mode 100644 index 0000000..a6fe99e --- /dev/null +++ b/bruiser/luatablegen/W_Local_Entry_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Local_Entry_H +#define _W_Local_Entry_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Local_Entry_tablegen.h" + +#include "../wasm.h" + +static W_Local_Entry* convert_W_Local_Entry (lua_State* __ls, int index) { + W_Local_Entry* dummy = (W_Local_Entry*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Local_Entry:bad user data type.\n"); + return dummy; +} + +static W_Local_Entry* check_W_Local_Entry(lua_State* __ls, int index) { + W_Local_Entry* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Local_Entry*)luaL_checkudata(__ls, index, "W_Local_Entry"); + if (dummy == NULL) printf("W_Local_Entry:bad user data type.\n"); + return dummy; +} + +W_Local_Entry* push_W_Local_Entry(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Local_Entry* dummy = lua_newuserdata(__ls, sizeof(W_Local_Entry)); + luaL_getmetatable(__ls, "W_Local_Entry"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Local_Entry_push_args(lua_State* __ls, W_Local_Entry* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushinteger(__ls, _st->type); + return 0; +} + +int new_W_Local_Entry(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + enum value_type_t type = luaL_optinteger(__ls,-1,0); + W_Local_Entry* dummy = push_W_Local_Entry(__ls); + dummy->count = count; + dummy->type = type; + return 1; +} + +static int getter_W_Local_Entry_count(lua_State* __ls) { + W_Local_Entry* dummy = check_W_Local_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Local_Entry_type(lua_State* __ls) { + W_Local_Entry* dummy = check_W_Local_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->type); + return 1; +} + +static int setter_W_Local_Entry_count(lua_State* __ls) { + W_Local_Entry* dummy = check_W_Local_Entry(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Local_Entry_type(lua_State* __ls) { + W_Local_Entry* dummy = check_W_Local_Entry(__ls, 1); + dummy->type = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Local_Entry_methods[] = { + {"new", new_W_Local_Entry}, + {"set_count", setter_W_Local_Entry_count}, + {"set_type", setter_W_Local_Entry_type}, + {"count", getter_W_Local_Entry_count}, + {"type", getter_W_Local_Entry_type}, + {0,0} +}; + +static const luaL_Reg W_Local_Entry_meta[] = { + {0, 0} +}; + +int W_Local_Entry_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Local_Entry", W_Local_Entry_methods, 0); + luaL_newmetatable(__ls, "W_Local_Entry"); + luaL_openlib(__ls, 0, W_Local_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 + + diff --git a/bruiser/luatablegen/W_Local_Entry_tablegen.h b/bruiser/luatablegen/W_Local_Entry_tablegen.h new file mode 100644 index 0000000..05a36dc --- /dev/null +++ b/bruiser/luatablegen/W_Local_Entry_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Local_Entry_H +#define _W_Local_Entry_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Local_Entry* convert_W_Local_Entry (lua_State* __ls, int index); +static W_Local_Entry* check_W_Local_Entry(lua_State* __ls, int index); +W_Local_Entry* push_W_Local_Entry(lua_State* __ls); +int W_Local_Entry_push_args(lua_State* __ls, W_Local_Entry* _st); +int new_W_Local_Entry(lua_State* __ls); +static int getter_W_Local_Entry_count(lua_State* __ls); +static int getter_W_Local_Entry_type(lua_State* __ls); +static int setter_W_Local_Entry_count(lua_State* __ls); +static int setter_W_Local_Entry_type(lua_State* __ls); +int W_Local_Entry_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Memory_Section_tablegen.c b/bruiser/luatablegen/W_Memory_Section_tablegen.c new file mode 100644 index 0000000..075d5ad --- /dev/null +++ b/bruiser/luatablegen/W_Memory_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Memory_Section_H +#define _W_Memory_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Memory_Section_tablegen.h" + +#include "../wasm.h" + +static W_Memory_Section* convert_W_Memory_Section (lua_State* __ls, int index) { + W_Memory_Section* dummy = (W_Memory_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Memory_Section:bad user data type.\n"); + return dummy; +} + +static W_Memory_Section* check_W_Memory_Section(lua_State* __ls, int index) { + W_Memory_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Memory_Section*)luaL_checkudata(__ls, index, "W_Memory_Section"); + if (dummy == NULL) printf("W_Memory_Section:bad user data type.\n"); + return dummy; +} + +W_Memory_Section* push_W_Memory_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Memory_Section* dummy = lua_newuserdata(__ls, sizeof(W_Memory_Section)); + luaL_getmetatable(__ls, "W_Memory_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Memory_Section_push_args(lua_State* __ls, W_Memory_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Memory_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + memory_type_t** entries = lua_touserdata(__ls,-1); + W_Memory_Section* dummy = push_W_Memory_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Memory_Section_count(lua_State* __ls) { + W_Memory_Section* dummy = check_W_Memory_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Memory_Section_entries(lua_State* __ls) { + W_Memory_Section* dummy = check_W_Memory_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Memory_Section_count(lua_State* __ls) { + W_Memory_Section* dummy = check_W_Memory_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Memory_Section_entries(lua_State* __ls) { + W_Memory_Section* dummy = check_W_Memory_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Memory_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Memory_Section_methods[] = { + {"new", new_W_Memory_Section}, + {"set_count", setter_W_Memory_Section_count}, + {"set_entries", setter_W_Memory_Section_entries}, + {"count", getter_W_Memory_Section_count}, + {"entries", getter_W_Memory_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Memory_Section_meta[] = { + {0, 0} +}; + +int W_Memory_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Memory_Section", W_Memory_Section_methods, 0); + luaL_newmetatable(__ls, "W_Memory_Section"); + luaL_openlib(__ls, 0, W_Memory_Section_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 + + diff --git a/bruiser/luatablegen/W_Memory_Section_tablegen.h b/bruiser/luatablegen/W_Memory_Section_tablegen.h new file mode 100644 index 0000000..54b9d84 --- /dev/null +++ b/bruiser/luatablegen/W_Memory_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Memory_Section_H +#define _W_Memory_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Memory_Section* convert_W_Memory_Section (lua_State* __ls, int index); +static W_Memory_Section* check_W_Memory_Section(lua_State* __ls, int index); +W_Memory_Section* push_W_Memory_Section(lua_State* __ls); +int W_Memory_Section_push_args(lua_State* __ls, W_Memory_Section* _st); +int new_W_Memory_Section(lua_State* __ls); +static int getter_W_Memory_Section_count(lua_State* __ls); +static int getter_W_Memory_Section_entries(lua_State* __ls); +static int setter_W_Memory_Section_count(lua_State* __ls); +static int setter_W_Memory_Section_entries(lua_State* __ls); +int W_Memory_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Start_Section_tablegen.c b/bruiser/luatablegen/W_Start_Section_tablegen.c new file mode 100644 index 0000000..1f46d8a --- /dev/null +++ b/bruiser/luatablegen/W_Start_Section_tablegen.c @@ -0,0 +1,97 @@ + +// 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_Start_Section_H +#define _W_Start_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Start_Section_tablegen.h" + +#include "../wasm.h" + +static W_Start_Section* convert_W_Start_Section (lua_State* __ls, int index) { + W_Start_Section* dummy = (W_Start_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Start_Section:bad user data type.\n"); + return dummy; +} + +static W_Start_Section* check_W_Start_Section(lua_State* __ls, int index) { + W_Start_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Start_Section*)luaL_checkudata(__ls, index, "W_Start_Section"); + if (dummy == NULL) printf("W_Start_Section:bad user data type.\n"); + return dummy; +} + +W_Start_Section* push_W_Start_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Start_Section* dummy = lua_newuserdata(__ls, sizeof(W_Start_Section)); + luaL_getmetatable(__ls, "W_Start_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Start_Section_push_args(lua_State* __ls, W_Start_Section* _st) { + lua_checkstack(__ls, 1); + lua_pushinteger(__ls, _st->index); + return 0; +} + +int new_W_Start_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + varuint32 index = luaL_optinteger(__ls,-1,0); + W_Start_Section* dummy = push_W_Start_Section(__ls); + dummy->index = index; + return 1; +} + +static int getter_W_Start_Section_index(lua_State* __ls) { + W_Start_Section* dummy = check_W_Start_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->index); + return 1; +} + +static int setter_W_Start_Section_index(lua_State* __ls) { + W_Start_Section* dummy = check_W_Start_Section(__ls, 1); + dummy->index = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Start_Section_methods[] = { + {"new", new_W_Start_Section}, + {"set_index", setter_W_Start_Section_index}, + {"index", getter_W_Start_Section_index}, + {0,0} +}; + +static const luaL_Reg W_Start_Section_meta[] = { + {0, 0} +}; + +int W_Start_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Start_Section", W_Start_Section_methods, 0); + luaL_newmetatable(__ls, "W_Start_Section"); + luaL_openlib(__ls, 0, W_Start_Section_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 + + diff --git a/bruiser/luatablegen/W_Start_Section_tablegen.h b/bruiser/luatablegen/W_Start_Section_tablegen.h new file mode 100644 index 0000000..8e740d3 --- /dev/null +++ b/bruiser/luatablegen/W_Start_Section_tablegen.h @@ -0,0 +1,30 @@ + +// 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_Start_Section_H +#define _W_Start_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Start_Section* convert_W_Start_Section (lua_State* __ls, int index); +static W_Start_Section* check_W_Start_Section(lua_State* __ls, int index); +W_Start_Section* push_W_Start_Section(lua_State* __ls); +int W_Start_Section_push_args(lua_State* __ls, W_Start_Section* _st); +int new_W_Start_Section(lua_State* __ls); +static int getter_W_Start_Section_index(lua_State* __ls); +static int setter_W_Start_Section_index(lua_State* __ls); +int W_Start_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Table_Section_tablegen.c b/bruiser/luatablegen/W_Table_Section_tablegen.c new file mode 100644 index 0000000..a27fb36 --- /dev/null +++ b/bruiser/luatablegen/W_Table_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Table_Section_H +#define _W_Table_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Table_Section_tablegen.h" + +#include "../wasm.h" + +static W_Table_Section* convert_W_Table_Section (lua_State* __ls, int index) { + W_Table_Section* dummy = (W_Table_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Table_Section:bad user data type.\n"); + return dummy; +} + +static W_Table_Section* check_W_Table_Section(lua_State* __ls, int index) { + W_Table_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Table_Section*)luaL_checkudata(__ls, index, "W_Table_Section"); + if (dummy == NULL) printf("W_Table_Section:bad user data type.\n"); + return dummy; +} + +W_Table_Section* push_W_Table_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Table_Section* dummy = lua_newuserdata(__ls, sizeof(W_Table_Section)); + luaL_getmetatable(__ls, "W_Table_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Table_Section_push_args(lua_State* __ls, W_Table_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Table_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + table_type_t** entries = lua_touserdata(__ls,-1); + W_Table_Section* dummy = push_W_Table_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Table_Section_count(lua_State* __ls) { + W_Table_Section* dummy = check_W_Table_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Table_Section_entries(lua_State* __ls) { + W_Table_Section* dummy = check_W_Table_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Table_Section_count(lua_State* __ls) { + W_Table_Section* dummy = check_W_Table_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Table_Section_entries(lua_State* __ls) { + W_Table_Section* dummy = check_W_Table_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Table_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Table_Section_methods[] = { + {"new", new_W_Table_Section}, + {"set_count", setter_W_Table_Section_count}, + {"set_entries", setter_W_Table_Section_entries}, + {"count", getter_W_Table_Section_count}, + {"entries", getter_W_Table_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Table_Section_meta[] = { + {0, 0} +}; + +int W_Table_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Table_Section", W_Table_Section_methods, 0); + luaL_newmetatable(__ls, "W_Table_Section"); + luaL_openlib(__ls, 0, W_Table_Section_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 + + diff --git a/bruiser/luatablegen/W_Table_Section_tablegen.h b/bruiser/luatablegen/W_Table_Section_tablegen.h new file mode 100644 index 0000000..5d10097 --- /dev/null +++ b/bruiser/luatablegen/W_Table_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Table_Section_H +#define _W_Table_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Table_Section* convert_W_Table_Section (lua_State* __ls, int index); +static W_Table_Section* check_W_Table_Section(lua_State* __ls, int index); +W_Table_Section* push_W_Table_Section(lua_State* __ls); +int W_Table_Section_push_args(lua_State* __ls, W_Table_Section* _st); +int new_W_Table_Section(lua_State* __ls); +static int getter_W_Table_Section_count(lua_State* __ls); +static int getter_W_Table_Section_entries(lua_State* __ls); +static int setter_W_Table_Section_count(lua_State* __ls); +static int setter_W_Table_Section_entries(lua_State* __ls); +int W_Table_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Type_Section_Entry_tablegen.c b/bruiser/luatablegen/W_Type_Section_Entry_tablegen.c new file mode 100644 index 0000000..4faeeb7 --- /dev/null +++ b/bruiser/luatablegen/W_Type_Section_Entry_tablegen.c @@ -0,0 +1,165 @@ + +// 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_Type_Section_Entry_H +#define _W_Type_Section_Entry_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Type_Section_Entry_tablegen.h" + +#include "../wasm.h" + +static W_Type_Section_Entry* convert_W_Type_Section_Entry (lua_State* __ls, int index) { + W_Type_Section_Entry* dummy = (W_Type_Section_Entry*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Type_Section_Entry:bad user data type.\n"); + return dummy; +} + +static W_Type_Section_Entry* check_W_Type_Section_Entry(lua_State* __ls, int index) { + W_Type_Section_Entry* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Type_Section_Entry*)luaL_checkudata(__ls, index, "W_Type_Section_Entry"); + if (dummy == NULL) printf("W_Type_Section_Entry:bad user data type.\n"); + return dummy; +} + +W_Type_Section_Entry* push_W_Type_Section_Entry(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Type_Section_Entry* dummy = lua_newuserdata(__ls, sizeof(W_Type_Section_Entry)); + luaL_getmetatable(__ls, "W_Type_Section_Entry"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Type_Section_Entry_push_args(lua_State* __ls, W_Type_Section_Entry* _st) { + lua_checkstack(__ls, 5); + lua_pushinteger(__ls, _st->form); + lua_pushinteger(__ls, _st->param_count); + lua_pushlightuserdata(__ls, _st->param_types); + lua_pushinteger(__ls, _st->return_count); + lua_pushlightuserdata(__ls, _st->return_types); + return 0; +} + +int new_W_Type_Section_Entry(lua_State* __ls) { + lua_checkstack(__ls, 5); + varint7 form = luaL_optinteger(__ls,-5,0); + varuint32 param_count = luaL_optinteger(__ls,-4,0); + varint7* param_types = lua_touserdata(__ls,-3); + varuint1 return_count = luaL_optinteger(__ls,-2,0); + varint7* return_types = lua_touserdata(__ls,-1); + W_Type_Section_Entry* dummy = push_W_Type_Section_Entry(__ls); + dummy->form = form; + dummy->param_count = param_count; + dummy->param_types = param_types; + dummy->return_count = return_count; + dummy->return_types = return_types; + return 1; +} + +static int getter_W_Type_Section_Entry_form(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->form); + return 1; +} +static int getter_W_Type_Section_Entry_param_count(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->param_count); + return 1; +} +static int getter_W_Type_Section_Entry_param_types(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->param_types); + return 1; +} +static int getter_W_Type_Section_Entry_return_count(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->return_count); + return 1; +} +static int getter_W_Type_Section_Entry_return_types(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->return_types); + return 1; +} + +static int setter_W_Type_Section_Entry_form(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + dummy->form = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Type_Section_Entry_param_count(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + dummy->param_count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Type_Section_Entry_param_types(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + dummy->param_types = luaL_checkudata(__ls, 2, "W_Type_Section_Entry"); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Type_Section_Entry_return_count(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + dummy->return_count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Type_Section_Entry_return_types(lua_State* __ls) { + W_Type_Section_Entry* dummy = check_W_Type_Section_Entry(__ls, 1); + dummy->return_types = luaL_checkudata(__ls, 2, "W_Type_Section_Entry"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Type_Section_Entry_methods[] = { + {"new", new_W_Type_Section_Entry}, + {"set_form", setter_W_Type_Section_Entry_form}, + {"set_param_count", setter_W_Type_Section_Entry_param_count}, + {"set_param_types", setter_W_Type_Section_Entry_param_types}, + {"set_return_count", setter_W_Type_Section_Entry_return_count}, + {"set_return_types", setter_W_Type_Section_Entry_return_types}, + {"form", getter_W_Type_Section_Entry_form}, + {"param_count", getter_W_Type_Section_Entry_param_count}, + {"param_types", getter_W_Type_Section_Entry_param_types}, + {"return_count", getter_W_Type_Section_Entry_return_count}, + {"return_types", getter_W_Type_Section_Entry_return_types}, + {0,0} +}; + +static const luaL_Reg W_Type_Section_Entry_meta[] = { + {0, 0} +}; + +int W_Type_Section_Entry_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Type_Section_Entry", W_Type_Section_Entry_methods, 0); + luaL_newmetatable(__ls, "W_Type_Section_Entry"); + luaL_openlib(__ls, 0, W_Type_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 + + diff --git a/bruiser/luatablegen/W_Type_Section_Entry_tablegen.h b/bruiser/luatablegen/W_Type_Section_Entry_tablegen.h new file mode 100644 index 0000000..25d445d --- /dev/null +++ b/bruiser/luatablegen/W_Type_Section_Entry_tablegen.h @@ -0,0 +1,38 @@ + +// 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_Type_Section_Entry_H +#define _W_Type_Section_Entry_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Type_Section_Entry* convert_W_Type_Section_Entry (lua_State* __ls, int index); +static W_Type_Section_Entry* check_W_Type_Section_Entry(lua_State* __ls, int index); +W_Type_Section_Entry* push_W_Type_Section_Entry(lua_State* __ls); +int W_Type_Section_Entry_push_args(lua_State* __ls, W_Type_Section_Entry* _st); +int new_W_Type_Section_Entry(lua_State* __ls); +static int getter_W_Type_Section_Entry_form(lua_State* __ls); +static int getter_W_Type_Section_Entry_param_count(lua_State* __ls); +static int getter_W_Type_Section_Entry_param_types(lua_State* __ls); +static int getter_W_Type_Section_Entry_return_count(lua_State* __ls); +static int getter_W_Type_Section_Entry_return_types(lua_State* __ls); +static int setter_W_Type_Section_Entry_form(lua_State* __ls); +static int setter_W_Type_Section_Entry_param_count(lua_State* __ls); +static int setter_W_Type_Section_Entry_param_types(lua_State* __ls); +static int setter_W_Type_Section_Entry_return_count(lua_State* __ls); +static int setter_W_Type_Section_Entry_return_types(lua_State* __ls); +int W_Type_Section_Entry_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/W_Type_Section_tablegen.c b/bruiser/luatablegen/W_Type_Section_tablegen.c new file mode 100644 index 0000000..3c784d1 --- /dev/null +++ b/bruiser/luatablegen/W_Type_Section_tablegen.c @@ -0,0 +1,114 @@ + +// 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_Type_Section_H +#define _W_Type_Section_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./W_Type_Section_tablegen.h" + +#include "../wasm.h" + +static W_Type_Section* convert_W_Type_Section (lua_State* __ls, int index) { + W_Type_Section* dummy = (W_Type_Section*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("W_Type_Section:bad user data type.\n"); + return dummy; +} + +static W_Type_Section* check_W_Type_Section(lua_State* __ls, int index) { + W_Type_Section* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (W_Type_Section*)luaL_checkudata(__ls, index, "W_Type_Section"); + if (dummy == NULL) printf("W_Type_Section:bad user data type.\n"); + return dummy; +} + +W_Type_Section* push_W_Type_Section(lua_State* __ls) { + lua_checkstack(__ls, 1); + W_Type_Section* dummy = lua_newuserdata(__ls, sizeof(W_Type_Section)); + luaL_getmetatable(__ls, "W_Type_Section"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int W_Type_Section_push_args(lua_State* __ls, W_Type_Section* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->count); + lua_pushlightuserdata(__ls, _st->entries); + return 0; +} + +int new_W_Type_Section(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 count = luaL_optinteger(__ls,-2,0); + W_Type_Section_Entry** entries = lua_touserdata(__ls,-1); + W_Type_Section* dummy = push_W_Type_Section(__ls); + dummy->count = count; + dummy->entries = entries; + return 1; +} + +static int getter_W_Type_Section_count(lua_State* __ls) { + W_Type_Section* dummy = check_W_Type_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->count); + return 1; +} +static int getter_W_Type_Section_entries(lua_State* __ls) { + W_Type_Section* dummy = check_W_Type_Section(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->entries); + return 1; +} + +static int setter_W_Type_Section_count(lua_State* __ls) { + W_Type_Section* dummy = check_W_Type_Section(__ls, 1); + dummy->count = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_W_Type_Section_entries(lua_State* __ls) { + W_Type_Section* dummy = check_W_Type_Section(__ls, 1); + dummy->entries = luaL_checkudata(__ls, 2, "W_Type_Section"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg W_Type_Section_methods[] = { + {"new", new_W_Type_Section}, + {"set_count", setter_W_Type_Section_count}, + {"set_entries", setter_W_Type_Section_entries}, + {"count", getter_W_Type_Section_count}, + {"entries", getter_W_Type_Section_entries}, + {0,0} +}; + +static const luaL_Reg W_Type_Section_meta[] = { + {0, 0} +}; + +int W_Type_Section_register(lua_State* __ls) { + luaL_openlib(__ls, "W_Type_Section", W_Type_Section_methods, 0); + luaL_newmetatable(__ls, "W_Type_Section"); + luaL_openlib(__ls, 0, W_Type_Section_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 + + diff --git a/bruiser/luatablegen/W_Type_Section_tablegen.h b/bruiser/luatablegen/W_Type_Section_tablegen.h new file mode 100644 index 0000000..68cc567 --- /dev/null +++ b/bruiser/luatablegen/W_Type_Section_tablegen.h @@ -0,0 +1,32 @@ + +// 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_Type_Section_H +#define _W_Type_Section_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static W_Type_Section* convert_W_Type_Section (lua_State* __ls, int index); +static W_Type_Section* check_W_Type_Section(lua_State* __ls, int index); +W_Type_Section* push_W_Type_Section(lua_State* __ls); +int W_Type_Section_push_args(lua_State* __ls, W_Type_Section* _st); +int new_W_Type_Section(lua_State* __ls); +static int getter_W_Type_Section_count(lua_State* __ls); +static int getter_W_Type_Section_entries(lua_State* __ls); +static int setter_W_Type_Section_count(lua_State* __ls); +static int setter_W_Type_Section_entries(lua_State* __ls); +int W_Type_Section_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/Wasm_Module_tablegen.c b/bruiser/luatablegen/Wasm_Module_tablegen.c new file mode 100644 index 0000000..724a7b3 --- /dev/null +++ b/bruiser/luatablegen/Wasm_Module_tablegen.c @@ -0,0 +1,301 @@ + +// 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 _Wasm_Module_H +#define _Wasm_Module_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./Wasm_Module_tablegen.h" + +#include "../wasm.h" + +static Wasm_Module* convert_Wasm_Module (lua_State* __ls, int index) { + Wasm_Module* dummy = (Wasm_Module*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("Wasm_Module:bad user data type.\n"); + return dummy; +} + +static Wasm_Module* check_Wasm_Module(lua_State* __ls, int index) { + Wasm_Module* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (Wasm_Module*)luaL_checkudata(__ls, index, "Wasm_Module"); + if (dummy == NULL) printf("Wasm_Module:bad user data type.\n"); + return dummy; +} + +Wasm_Module* push_Wasm_Module(lua_State* __ls) { + lua_checkstack(__ls, 1); + Wasm_Module* dummy = lua_newuserdata(__ls, sizeof(Wasm_Module)); + luaL_getmetatable(__ls, "Wasm_Module"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int Wasm_Module_push_args(lua_State* __ls, Wasm_Module* _st) { + lua_checkstack(__ls, 13); + lua_pushlightuserdata(__ls, _st->type_section); + lua_pushlightuserdata(__ls, _st->import_section); + lua_pushlightuserdata(__ls, _st->function_section); + lua_pushlightuserdata(__ls, _st->table_section); + lua_pushlightuserdata(__ls, _st->memory_section); + lua_pushlightuserdata(__ls, _st->global_section); + lua_pushlightuserdata(__ls, _st->export_section); + lua_pushlightuserdata(__ls, _st->start_section); + lua_pushlightuserdata(__ls, _st->element_section); + lua_pushlightuserdata(__ls, _st->code_section); + lua_pushlightuserdata(__ls, _st->data_section); + lua_pushlightuserdata(__ls, _st->W_Custom_Sections); + lua_pushstring(__ls, _st->name); + return 0; +} + +int new_Wasm_Module(lua_State* __ls) { + lua_checkstack(__ls, 13); + W_Type_Section* type_section = lua_touserdata(__ls,-13); + W_Import_Section* import_section = lua_touserdata(__ls,-12); + W_Function_Section* function_section = lua_touserdata(__ls,-11); + W_Table_Section* table_section = lua_touserdata(__ls,-10); + W_Memory_Section* memory_section = lua_touserdata(__ls,-9); + W_Global_Section* global_section = lua_touserdata(__ls,-8); + W_Export_Section* export_section = lua_touserdata(__ls,-7); + W_Start_Section* start_section = lua_touserdata(__ls,-6); + W_Element_Section* element_section = lua_touserdata(__ls,-5); + W_Code_Section* code_section = lua_touserdata(__ls,-4); + W_Data_Section* data_section = lua_touserdata(__ls,-3); + void** W_Custom_Sections = lua_touserdata(__ls,-2); + char* name = lua_tostring(__ls,-1); + Wasm_Module* dummy = push_Wasm_Module(__ls); + dummy->type_section = type_section; + dummy->import_section = import_section; + dummy->function_section = function_section; + dummy->table_section = table_section; + dummy->memory_section = memory_section; + dummy->global_section = global_section; + dummy->export_section = export_section; + dummy->start_section = start_section; + dummy->element_section = element_section; + dummy->code_section = code_section; + dummy->data_section = data_section; + dummy->W_Custom_Sections = W_Custom_Sections; + dummy->name = name; + return 1; +} + +static int getter_Wasm_Module_type_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->type_section); + return 1; +} +static int getter_Wasm_Module_import_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->import_section); + return 1; +} +static int getter_Wasm_Module_function_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->function_section); + return 1; +} +static int getter_Wasm_Module_table_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->table_section); + return 1; +} +static int getter_Wasm_Module_memory_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->memory_section); + return 1; +} +static int getter_Wasm_Module_global_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->global_section); + return 1; +} +static int getter_Wasm_Module_export_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->export_section); + return 1; +} +static int getter_Wasm_Module_start_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->start_section); + return 1; +} +static int getter_Wasm_Module_element_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->element_section); + return 1; +} +static int getter_Wasm_Module_code_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->code_section); + return 1; +} +static int getter_Wasm_Module_data_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->data_section); + return 1; +} +static int getter_Wasm_Module_W_Custom_Sections(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->W_Custom_Sections); + return 1; +} +static int getter_Wasm_Module_name(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->name); + return 1; +} + +static int setter_Wasm_Module_type_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->type_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_import_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->import_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_function_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->function_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_table_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->table_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_memory_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->memory_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_global_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->global_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_export_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->export_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_start_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->start_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_element_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->element_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_code_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->code_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_data_section(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->data_section = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_W_Custom_Sections(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->W_Custom_Sections = luaL_checkudata(__ls, 2, "Wasm_Module"); + lua_settop(__ls, 1); + return 1; +} +static int setter_Wasm_Module_name(lua_State* __ls) { + Wasm_Module* dummy = check_Wasm_Module(__ls, 1); + dummy->name = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg Wasm_Module_methods[] = { + {"new", new_Wasm_Module}, + {"set_type_section", setter_Wasm_Module_type_section}, + {"set_import_section", setter_Wasm_Module_import_section}, + {"set_function_section", setter_Wasm_Module_function_section}, + {"set_table_section", setter_Wasm_Module_table_section}, + {"set_memory_section", setter_Wasm_Module_memory_section}, + {"set_global_section", setter_Wasm_Module_global_section}, + {"set_export_section", setter_Wasm_Module_export_section}, + {"set_start_section", setter_Wasm_Module_start_section}, + {"set_element_section", setter_Wasm_Module_element_section}, + {"set_code_section", setter_Wasm_Module_code_section}, + {"set_data_section", setter_Wasm_Module_data_section}, + {"set_W_Custom_Sections", setter_Wasm_Module_W_Custom_Sections}, + {"set_name", setter_Wasm_Module_name}, + {"type_section", getter_Wasm_Module_type_section}, + {"import_section", getter_Wasm_Module_import_section}, + {"function_section", getter_Wasm_Module_function_section}, + {"table_section", getter_Wasm_Module_table_section}, + {"memory_section", getter_Wasm_Module_memory_section}, + {"global_section", getter_Wasm_Module_global_section}, + {"export_section", getter_Wasm_Module_export_section}, + {"start_section", getter_Wasm_Module_start_section}, + {"element_section", getter_Wasm_Module_element_section}, + {"code_section", getter_Wasm_Module_code_section}, + {"data_section", getter_Wasm_Module_data_section}, + {"W_Custom_Sections", getter_Wasm_Module_W_Custom_Sections}, + {"name", getter_Wasm_Module_name}, + {0,0} +}; + +static const luaL_Reg Wasm_Module_meta[] = { + {0, 0} +}; + +int Wasm_Module_register(lua_State* __ls) { + luaL_openlib(__ls, "Wasm_Module", Wasm_Module_methods, 0); + luaL_newmetatable(__ls, "Wasm_Module"); + luaL_openlib(__ls, 0, Wasm_Module_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 + + diff --git a/bruiser/luatablegen/Wasm_Module_tablegen.h b/bruiser/luatablegen/Wasm_Module_tablegen.h new file mode 100644 index 0000000..795b219 --- /dev/null +++ b/bruiser/luatablegen/Wasm_Module_tablegen.h @@ -0,0 +1,54 @@ + +// 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 _Wasm_Module_H +#define _Wasm_Module_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static Wasm_Module* convert_Wasm_Module (lua_State* __ls, int index); +static Wasm_Module* check_Wasm_Module(lua_State* __ls, int index); +Wasm_Module* push_Wasm_Module(lua_State* __ls); +int Wasm_Module_push_args(lua_State* __ls, Wasm_Module* _st); +int new_Wasm_Module(lua_State* __ls); +static int getter_Wasm_Module_type_section(lua_State* __ls); +static int getter_Wasm_Module_import_section(lua_State* __ls); +static int getter_Wasm_Module_function_section(lua_State* __ls); +static int getter_Wasm_Module_table_section(lua_State* __ls); +static int getter_Wasm_Module_memory_section(lua_State* __ls); +static int getter_Wasm_Module_global_section(lua_State* __ls); +static int getter_Wasm_Module_export_section(lua_State* __ls); +static int getter_Wasm_Module_start_section(lua_State* __ls); +static int getter_Wasm_Module_element_section(lua_State* __ls); +static int getter_Wasm_Module_code_section(lua_State* __ls); +static int getter_Wasm_Module_data_section(lua_State* __ls); +static int getter_Wasm_Module_W_Custom_Sections(lua_State* __ls); +static int getter_Wasm_Module_name(lua_State* __ls); +static int setter_Wasm_Module_type_section(lua_State* __ls); +static int setter_Wasm_Module_import_section(lua_State* __ls); +static int setter_Wasm_Module_function_section(lua_State* __ls); +static int setter_Wasm_Module_table_section(lua_State* __ls); +static int setter_Wasm_Module_memory_section(lua_State* __ls); +static int setter_Wasm_Module_global_section(lua_State* __ls); +static int setter_Wasm_Module_export_section(lua_State* __ls); +static int setter_Wasm_Module_start_section(lua_State* __ls); +static int setter_Wasm_Module_element_section(lua_State* __ls); +static int setter_Wasm_Module_code_section(lua_State* __ls); +static int setter_Wasm_Module_data_section(lua_State* __ls); +static int setter_Wasm_Module_W_Custom_Sections(lua_State* __ls); +static int setter_Wasm_Module_name(lua_State* __ls); +int Wasm_Module_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/global_type_t_tablegen.c b/bruiser/luatablegen/global_type_t_tablegen.c new file mode 100644 index 0000000..d583294 --- /dev/null +++ b/bruiser/luatablegen/global_type_t_tablegen.c @@ -0,0 +1,114 @@ + +// 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 _global_type_t_H +#define _global_type_t_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./global_type_t_tablegen.h" + +#include "../wasm.h" + +static global_type_t* convert_global_type_t (lua_State* __ls, int index) { + global_type_t* dummy = (global_type_t*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("global_type_t:bad user data type.\n"); + return dummy; +} + +static global_type_t* check_global_type_t(lua_State* __ls, int index) { + global_type_t* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (global_type_t*)luaL_checkudata(__ls, index, "global_type_t"); + if (dummy == NULL) printf("global_type_t:bad user data type.\n"); + return dummy; +} + +global_type_t* push_global_type_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + global_type_t* dummy = lua_newuserdata(__ls, sizeof(global_type_t)); + luaL_getmetatable(__ls, "global_type_t"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int global_type_t_push_args(lua_State* __ls, global_type_t* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->value_type); + lua_pushinteger(__ls, _st->mutability); + return 0; +} + +int new_global_type_t(lua_State* __ls) { + lua_checkstack(__ls, 2); + enum value_type_t value_type = luaL_optinteger(__ls,-2,0); + varuint1 mutability = luaL_optinteger(__ls,-1,0); + global_type_t* dummy = push_global_type_t(__ls); + dummy->value_type = value_type; + dummy->mutability = mutability; + return 1; +} + +static int getter_global_type_t_value_type(lua_State* __ls) { + global_type_t* dummy = check_global_type_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->value_type); + return 1; +} +static int getter_global_type_t_mutability(lua_State* __ls) { + global_type_t* dummy = check_global_type_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->mutability); + return 1; +} + +static int setter_global_type_t_value_type(lua_State* __ls) { + global_type_t* dummy = check_global_type_t(__ls, 1); + dummy->value_type = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_global_type_t_mutability(lua_State* __ls) { + global_type_t* dummy = check_global_type_t(__ls, 1); + dummy->mutability = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg global_type_t_methods[] = { + {"new", new_global_type_t}, + {"set_value_type", setter_global_type_t_value_type}, + {"set_mutability", setter_global_type_t_mutability}, + {"value_type", getter_global_type_t_value_type}, + {"mutability", getter_global_type_t_mutability}, + {0,0} +}; + +static const luaL_Reg global_type_t_meta[] = { + {0, 0} +}; + +int global_type_t_register(lua_State* __ls) { + luaL_openlib(__ls, "global_type_t", global_type_t_methods, 0); + luaL_newmetatable(__ls, "global_type_t"); + luaL_openlib(__ls, 0, global_type_t_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 + + diff --git a/bruiser/luatablegen/global_type_t_tablegen.h b/bruiser/luatablegen/global_type_t_tablegen.h new file mode 100644 index 0000000..15a2c9e --- /dev/null +++ b/bruiser/luatablegen/global_type_t_tablegen.h @@ -0,0 +1,32 @@ + +// 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 _global_type_t_H +#define _global_type_t_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static global_type_t* convert_global_type_t (lua_State* __ls, int index); +static global_type_t* check_global_type_t(lua_State* __ls, int index); +global_type_t* push_global_type_t(lua_State* __ls); +int global_type_t_push_args(lua_State* __ls, global_type_t* _st); +int new_global_type_t(lua_State* __ls); +static int getter_global_type_t_value_type(lua_State* __ls); +static int getter_global_type_t_mutability(lua_State* __ls); +static int setter_global_type_t_value_type(lua_State* __ls); +static int setter_global_type_t_mutability(lua_State* __ls); +int global_type_t_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/init_expr_t_tablegen.c b/bruiser/luatablegen/init_expr_t_tablegen.c new file mode 100644 index 0000000..08a6a3f --- /dev/null +++ b/bruiser/luatablegen/init_expr_t_tablegen.c @@ -0,0 +1,114 @@ + +// 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 _init_expr_t_H +#define _init_expr_t_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./init_expr_t_tablegen.h" + +#include "../wasm.h" + +static init_expr_t* convert_init_expr_t (lua_State* __ls, int index) { + init_expr_t* dummy = (init_expr_t*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("init_expr_t:bad user data type.\n"); + return dummy; +} + +static init_expr_t* check_init_expr_t(lua_State* __ls, int index) { + init_expr_t* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (init_expr_t*)luaL_checkudata(__ls, index, "init_expr_t"); + if (dummy == NULL) printf("init_expr_t:bad user data type.\n"); + return dummy; +} + +init_expr_t* push_init_expr_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + init_expr_t* dummy = lua_newuserdata(__ls, sizeof(init_expr_t)); + luaL_getmetatable(__ls, "init_expr_t"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int init_expr_t_push_args(lua_State* __ls, init_expr_t* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->size); + lua_pushstring(__ls, _st->code); + return 0; +} + +int new_init_expr_t(lua_State* __ls) { + lua_checkstack(__ls, 2); + varuint32 size = luaL_optinteger(__ls,-2,0); + char* code = lua_tostring(__ls,-1); + init_expr_t* dummy = push_init_expr_t(__ls); + dummy->size = size; + dummy->code = code; + return 1; +} + +static int getter_init_expr_t_size(lua_State* __ls) { + init_expr_t* dummy = check_init_expr_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->size); + return 1; +} +static int getter_init_expr_t_code(lua_State* __ls) { + init_expr_t* dummy = check_init_expr_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushstring(__ls, dummy->code); + return 1; +} + +static int setter_init_expr_t_size(lua_State* __ls) { + init_expr_t* dummy = check_init_expr_t(__ls, 1); + dummy->size = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_init_expr_t_code(lua_State* __ls) { + init_expr_t* dummy = check_init_expr_t(__ls, 1); + dummy->code = luaL_checkstring(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg init_expr_t_methods[] = { + {"new", new_init_expr_t}, + {"set_size", setter_init_expr_t_size}, + {"set_code", setter_init_expr_t_code}, + {"size", getter_init_expr_t_size}, + {"code", getter_init_expr_t_code}, + {0,0} +}; + +static const luaL_Reg init_expr_t_meta[] = { + {0, 0} +}; + +int init_expr_t_register(lua_State* __ls) { + luaL_openlib(__ls, "init_expr_t", init_expr_t_methods, 0); + luaL_newmetatable(__ls, "init_expr_t"); + luaL_openlib(__ls, 0, init_expr_t_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 + + diff --git a/bruiser/luatablegen/init_expr_t_tablegen.h b/bruiser/luatablegen/init_expr_t_tablegen.h new file mode 100644 index 0000000..3f7b518 --- /dev/null +++ b/bruiser/luatablegen/init_expr_t_tablegen.h @@ -0,0 +1,32 @@ + +// 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 _init_expr_t_H +#define _init_expr_t_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static init_expr_t* convert_init_expr_t (lua_State* __ls, int index); +static init_expr_t* check_init_expr_t(lua_State* __ls, int index); +init_expr_t* push_init_expr_t(lua_State* __ls); +int init_expr_t_push_args(lua_State* __ls, init_expr_t* _st); +int new_init_expr_t(lua_State* __ls); +static int getter_init_expr_t_size(lua_State* __ls); +static int getter_init_expr_t_code(lua_State* __ls); +static int setter_init_expr_t_size(lua_State* __ls); +static int setter_init_expr_t_code(lua_State* __ls); +int init_expr_t_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/memory_type_t_tablegen.c b/bruiser/luatablegen/memory_type_t_tablegen.c new file mode 100644 index 0000000..fe921bc --- /dev/null +++ b/bruiser/luatablegen/memory_type_t_tablegen.c @@ -0,0 +1,97 @@ + +// 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 _memory_type_t_H +#define _memory_type_t_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./memory_type_t_tablegen.h" + +#include "../wasm.h" + +static memory_type_t* convert_memory_type_t (lua_State* __ls, int index) { + memory_type_t* dummy = (memory_type_t*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("memory_type_t:bad user data type.\n"); + return dummy; +} + +static memory_type_t* check_memory_type_t(lua_State* __ls, int index) { + memory_type_t* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (memory_type_t*)luaL_checkudata(__ls, index, "memory_type_t"); + if (dummy == NULL) printf("memory_type_t:bad user data type.\n"); + return dummy; +} + +memory_type_t* push_memory_type_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + memory_type_t* dummy = lua_newuserdata(__ls, sizeof(memory_type_t)); + luaL_getmetatable(__ls, "memory_type_t"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int memory_type_t_push_args(lua_State* __ls, memory_type_t* _st) { + lua_checkstack(__ls, 1); + lua_pushlightuserdata(__ls, _st->resizable_limit); + return 0; +} + +int new_memory_type_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + resizable_limit_t* resizable_limit = lua_touserdata(__ls,-1); + memory_type_t* dummy = push_memory_type_t(__ls); + dummy->resizable_limit = resizable_limit; + return 1; +} + +static int getter_memory_type_t_resizable_limit(lua_State* __ls) { + memory_type_t* dummy = check_memory_type_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->resizable_limit); + return 1; +} + +static int setter_memory_type_t_resizable_limit(lua_State* __ls) { + memory_type_t* dummy = check_memory_type_t(__ls, 1); + dummy->resizable_limit = luaL_checkudata(__ls, 2, "memory_type_t"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg memory_type_t_methods[] = { + {"new", new_memory_type_t}, + {"set_resizable_limit", setter_memory_type_t_resizable_limit}, + {"resizable_limit", getter_memory_type_t_resizable_limit}, + {0,0} +}; + +static const luaL_Reg memory_type_t_meta[] = { + {0, 0} +}; + +int memory_type_t_register(lua_State* __ls) { + luaL_openlib(__ls, "memory_type_t", memory_type_t_methods, 0); + luaL_newmetatable(__ls, "memory_type_t"); + luaL_openlib(__ls, 0, memory_type_t_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 + + diff --git a/bruiser/luatablegen/memory_type_t_tablegen.h b/bruiser/luatablegen/memory_type_t_tablegen.h new file mode 100644 index 0000000..ffd02a9 --- /dev/null +++ b/bruiser/luatablegen/memory_type_t_tablegen.h @@ -0,0 +1,30 @@ + +// 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 _memory_type_t_H +#define _memory_type_t_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static memory_type_t* convert_memory_type_t (lua_State* __ls, int index); +static memory_type_t* check_memory_type_t(lua_State* __ls, int index); +memory_type_t* push_memory_type_t(lua_State* __ls); +int memory_type_t_push_args(lua_State* __ls, memory_type_t* _st); +int new_memory_type_t(lua_State* __ls); +static int getter_memory_type_t_resizable_limit(lua_State* __ls); +static int setter_memory_type_t_resizable_limit(lua_State* __ls); +int memory_type_t_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/resizable_limit_t_tablegen.c b/bruiser/luatablegen/resizable_limit_t_tablegen.c new file mode 100644 index 0000000..16f0432 --- /dev/null +++ b/bruiser/luatablegen/resizable_limit_t_tablegen.c @@ -0,0 +1,131 @@ + +// 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 _resizable_limit_t_H +#define _resizable_limit_t_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./resizable_limit_t_tablegen.h" + +#include "../wasm.h" + +static resizable_limit_t* convert_resizable_limit_t (lua_State* __ls, int index) { + resizable_limit_t* dummy = (resizable_limit_t*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("resizable_limit_t:bad user data type.\n"); + return dummy; +} + +static resizable_limit_t* check_resizable_limit_t(lua_State* __ls, int index) { + resizable_limit_t* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (resizable_limit_t*)luaL_checkudata(__ls, index, "resizable_limit_t"); + if (dummy == NULL) printf("resizable_limit_t:bad user data type.\n"); + return dummy; +} + +resizable_limit_t* push_resizable_limit_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + resizable_limit_t* dummy = lua_newuserdata(__ls, sizeof(resizable_limit_t)); + luaL_getmetatable(__ls, "resizable_limit_t"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int resizable_limit_t_push_args(lua_State* __ls, resizable_limit_t* _st) { + lua_checkstack(__ls, 3); + lua_pushinteger(__ls, _st->flags); + lua_pushinteger(__ls, _st->initial); + lua_pushinteger(__ls, _st->maximum); + return 0; +} + +int new_resizable_limit_t(lua_State* __ls) { + lua_checkstack(__ls, 3); + varuint1 flags = luaL_optinteger(__ls,-3,0); + varuint32 initial = luaL_optinteger(__ls,-2,0); + varuint32 maximum = luaL_optinteger(__ls,-1,0); + resizable_limit_t* dummy = push_resizable_limit_t(__ls); + dummy->flags = flags; + dummy->initial = initial; + dummy->maximum = maximum; + return 1; +} + +static int getter_resizable_limit_t_flags(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->flags); + return 1; +} +static int getter_resizable_limit_t_initial(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->initial); + return 1; +} +static int getter_resizable_limit_t_maximum(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->maximum); + return 1; +} + +static int setter_resizable_limit_t_flags(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + dummy->flags = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_resizable_limit_t_initial(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + dummy->initial = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_resizable_limit_t_maximum(lua_State* __ls) { + resizable_limit_t* dummy = check_resizable_limit_t(__ls, 1); + dummy->maximum = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg resizable_limit_t_methods[] = { + {"new", new_resizable_limit_t}, + {"set_flags", setter_resizable_limit_t_flags}, + {"set_initial", setter_resizable_limit_t_initial}, + {"set_maximum", setter_resizable_limit_t_maximum}, + {"flags", getter_resizable_limit_t_flags}, + {"initial", getter_resizable_limit_t_initial}, + {"maximum", getter_resizable_limit_t_maximum}, + {0,0} +}; + +static const luaL_Reg resizable_limit_t_meta[] = { + {0, 0} +}; + +int resizable_limit_t_register(lua_State* __ls) { + luaL_openlib(__ls, "resizable_limit_t", resizable_limit_t_methods, 0); + luaL_newmetatable(__ls, "resizable_limit_t"); + luaL_openlib(__ls, 0, resizable_limit_t_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 + + diff --git a/bruiser/luatablegen/resizable_limit_t_tablegen.h b/bruiser/luatablegen/resizable_limit_t_tablegen.h new file mode 100644 index 0000000..bd9ab6f --- /dev/null +++ b/bruiser/luatablegen/resizable_limit_t_tablegen.h @@ -0,0 +1,34 @@ + +// 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 _resizable_limit_t_H +#define _resizable_limit_t_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static resizable_limit_t* convert_resizable_limit_t (lua_State* __ls, int index); +static resizable_limit_t* check_resizable_limit_t(lua_State* __ls, int index); +resizable_limit_t* push_resizable_limit_t(lua_State* __ls); +int resizable_limit_t_push_args(lua_State* __ls, resizable_limit_t* _st); +int new_resizable_limit_t(lua_State* __ls); +static int getter_resizable_limit_t_flags(lua_State* __ls); +static int getter_resizable_limit_t_initial(lua_State* __ls); +static int getter_resizable_limit_t_maximum(lua_State* __ls); +static int setter_resizable_limit_t_flags(lua_State* __ls); +static int setter_resizable_limit_t_initial(lua_State* __ls); +static int setter_resizable_limit_t_maximum(lua_State* __ls); +int resizable_limit_t_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/table_type_t_tablegen.c b/bruiser/luatablegen/table_type_t_tablegen.c new file mode 100644 index 0000000..21dd9da --- /dev/null +++ b/bruiser/luatablegen/table_type_t_tablegen.c @@ -0,0 +1,114 @@ + +// 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 _table_type_t_H +#define _table_type_t_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./table_type_t_tablegen.h" + +#include "../wasm.h" + +static table_type_t* convert_table_type_t (lua_State* __ls, int index) { + table_type_t* dummy = (table_type_t*)lua_touserdata(__ls, index); + if (dummy == NULL) printf("table_type_t:bad user data type.\n"); + return dummy; +} + +static table_type_t* check_table_type_t(lua_State* __ls, int index) { + table_type_t* dummy; + luaL_checktype(__ls, index, LUA_TUSERDATA); + dummy = (table_type_t*)luaL_checkudata(__ls, index, "table_type_t"); + if (dummy == NULL) printf("table_type_t:bad user data type.\n"); + return dummy; +} + +table_type_t* push_table_type_t(lua_State* __ls) { + lua_checkstack(__ls, 1); + table_type_t* dummy = lua_newuserdata(__ls, sizeof(table_type_t)); + luaL_getmetatable(__ls, "table_type_t"); + lua_setmetatable(__ls, -2); + return dummy; +} + +int table_type_t_push_args(lua_State* __ls, table_type_t* _st) { + lua_checkstack(__ls, 2); + lua_pushinteger(__ls, _st->element_type); + lua_pushlightuserdata(__ls, _st->resizable_limit); + return 0; +} + +int new_table_type_t(lua_State* __ls) { + lua_checkstack(__ls, 2); + varint7 element_type = luaL_optinteger(__ls,-2,0); + resizable_limit_t* resizable_limit = lua_touserdata(__ls,-1); + table_type_t* dummy = push_table_type_t(__ls); + dummy->element_type = element_type; + dummy->resizable_limit = resizable_limit; + return 1; +} + +static int getter_table_type_t_element_type(lua_State* __ls) { + table_type_t* dummy = check_table_type_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushinteger(__ls, dummy->element_type); + return 1; +} +static int getter_table_type_t_resizable_limit(lua_State* __ls) { + table_type_t* dummy = check_table_type_t(__ls, 1); + lua_pop(__ls, -1); + lua_pushlightuserdata(__ls, dummy->resizable_limit); + return 1; +} + +static int setter_table_type_t_element_type(lua_State* __ls) { + table_type_t* dummy = check_table_type_t(__ls, 1); + dummy->element_type = luaL_checkinteger(__ls, 2); + lua_settop(__ls, 1); + return 1; +} +static int setter_table_type_t_resizable_limit(lua_State* __ls) { + table_type_t* dummy = check_table_type_t(__ls, 1); + dummy->resizable_limit = luaL_checkudata(__ls, 2, "table_type_t"); + lua_settop(__ls, 1); + return 1; +} + +static const luaL_Reg table_type_t_methods[] = { + {"new", new_table_type_t}, + {"set_element_type", setter_table_type_t_element_type}, + {"set_resizable_limit", setter_table_type_t_resizable_limit}, + {"element_type", getter_table_type_t_element_type}, + {"resizable_limit", getter_table_type_t_resizable_limit}, + {0,0} +}; + +static const luaL_Reg table_type_t_meta[] = { + {0, 0} +}; + +int table_type_t_register(lua_State* __ls) { + luaL_openlib(__ls, "table_type_t", table_type_t_methods, 0); + luaL_newmetatable(__ls, "table_type_t"); + luaL_openlib(__ls, 0, table_type_t_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 + + diff --git a/bruiser/luatablegen/table_type_t_tablegen.h b/bruiser/luatablegen/table_type_t_tablegen.h new file mode 100644 index 0000000..c2aed8b --- /dev/null +++ b/bruiser/luatablegen/table_type_t_tablegen.h @@ -0,0 +1,32 @@ + +// 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 _table_type_t_H +#define _table_type_t_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "../wasm.h" + +static table_type_t* convert_table_type_t (lua_State* __ls, int index); +static table_type_t* check_table_type_t(lua_State* __ls, int index); +table_type_t* push_table_type_t(lua_State* __ls); +int table_type_t_push_args(lua_State* __ls, table_type_t* _st); +int new_table_type_t(lua_State* __ls); +static int getter_table_type_t_element_type(lua_State* __ls); +static int getter_table_type_t_resizable_limit(lua_State* __ls); +static int setter_table_type_t_element_type(lua_State* __ls); +static int setter_table_type_t_resizable_limit(lua_State* __ls); +int table_type_t_register(lua_State* __ls); + +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + + diff --git a/bruiser/luatablegen/wasm_tables.c b/bruiser/luatablegen/wasm_tables.c new file mode 100644 index 0000000..3ab2ec4 --- /dev/null +++ b/bruiser/luatablegen/wasm_tables.c @@ -0,0 +1,82 @@ +// automatically generated by luatablegen + +#include "./init_expr_t_tablegen.h" +#include "./resizable_limit_t_tablegen.h" +#include "./global_type_t_tablegen.h" +#include "./table_type_t_tablegen.h" +#include "./memory_type_t_tablegen.h" +#include "./W_Type_Section_Entry_tablegen.h" +#include "./W_Type_Section_tablegen.h" +#include "./W_Import_Section_Entry_tablegen.h" +#include "./W_Import_Section_tablegen.h" +#include "./W_Function_Section_tablegen.h" +#include "./W_Table_Section_tablegen.h" +#include "./W_Memory_Section_tablegen.h" +#include "./W_Global_Entry_tablegen.h" +#include "./W_Global_Section_tablegen.h" +#include "./W_Export_Entry_tablegen.h" +#include "./W_Export_Section_tablegen.h" +#include "./W_Start_Section_tablegen.h" +#include "./W_Elem_Segment_tablegen.h" +#include "./W_Element_Section_tablegen.h" +#include "./W_Local_Entry_tablegen.h" +#include "./W_Function_Body_tablegen.h" +#include "./W_Code_Section_tablegen.h" +#include "./W_Data_Segment_tablegen.h" +#include "./W_Data_Section_tablegen.h" +#include "./Wasm_Module_tablegen.h" +#include "./wasm_tables.h" + +void reg_tablegen_tables(lua_State* __ls) { + init_expr_t_register(__ls); + lua_pop(__ls, 1); + resizable_limit_t_register(__ls); + lua_pop(__ls, 1); + global_type_t_register(__ls); + lua_pop(__ls, 1); + table_type_t_register(__ls); + lua_pop(__ls, 1); + memory_type_t_register(__ls); + lua_pop(__ls, 1); + W_Type_Section_Entry_register(__ls); + lua_pop(__ls, 1); + W_Type_Section_register(__ls); + lua_pop(__ls, 1); + W_Import_Section_Entry_register(__ls); + lua_pop(__ls, 1); + W_Import_Section_register(__ls); + lua_pop(__ls, 1); + W_Function_Section_register(__ls); + lua_pop(__ls, 1); + W_Table_Section_register(__ls); + lua_pop(__ls, 1); + W_Memory_Section_register(__ls); + lua_pop(__ls, 1); + W_Global_Entry_register(__ls); + lua_pop(__ls, 1); + W_Global_Section_register(__ls); + lua_pop(__ls, 1); + W_Export_Entry_register(__ls); + lua_pop(__ls, 1); + W_Export_Section_register(__ls); + lua_pop(__ls, 1); + W_Start_Section_register(__ls); + lua_pop(__ls, 1); + W_Elem_Segment_register(__ls); + lua_pop(__ls, 1); + W_Element_Section_register(__ls); + lua_pop(__ls, 1); + W_Local_Entry_register(__ls); + lua_pop(__ls, 1); + W_Function_Body_register(__ls); + lua_pop(__ls, 1); + W_Code_Section_register(__ls); + lua_pop(__ls, 1); + W_Data_Segment_register(__ls); + lua_pop(__ls, 1); + W_Data_Section_register(__ls); + lua_pop(__ls, 1); + Wasm_Module_register(__ls); + lua_pop(__ls, 1); +} + diff --git a/bruiser/luatablegen/wasm_tables.h b/bruiser/luatablegen/wasm_tables.h new file mode 100644 index 0000000..eef67e1 --- /dev/null +++ b/bruiser/luatablegen/wasm_tables.h @@ -0,0 +1,38 @@ +// automatically generated by luatablegen + +#ifndef _WASM_TABLES_AGGR_H +#define _WASM_TABLES_AGGR_H +#ifdef __cplusplus +extern "C" { +#endif +#include "./init_expr_t_tablegen.h" +#include "./resizable_limit_t_tablegen.h" +#include "./global_type_t_tablegen.h" +#include "./table_type_t_tablegen.h" +#include "./memory_type_t_tablegen.h" +#include "./W_Type_Section_Entry_tablegen.h" +#include "./W_Type_Section_tablegen.h" +#include "./W_Import_Section_Entry_tablegen.h" +#include "./W_Import_Section_tablegen.h" +#include "./W_Function_Section_tablegen.h" +#include "./W_Table_Section_tablegen.h" +#include "./W_Memory_Section_tablegen.h" +#include "./W_Global_Entry_tablegen.h" +#include "./W_Global_Section_tablegen.h" +#include "./W_Export_Entry_tablegen.h" +#include "./W_Export_Section_tablegen.h" +#include "./W_Start_Section_tablegen.h" +#include "./W_Elem_Segment_tablegen.h" +#include "./W_Element_Section_tablegen.h" +#include "./W_Local_Entry_tablegen.h" +#include "./W_Function_Body_tablegen.h" +#include "./W_Code_Section_tablegen.h" +#include "./W_Data_Segment_tablegen.h" +#include "./W_Data_Section_tablegen.h" +#include "./Wasm_Module_tablegen.h" +void reg_tablegen_tables(lua_State* __ls); +#ifdef __cplusplus +} +#endif //end of extern c +#endif //end of inclusion guard + diff --git a/bruiser/luatablegen/wasmheader.txt b/bruiser/luatablegen/wasmheader.txt new file mode 100644 index 0000000..4c20d66 --- /dev/null +++ b/bruiser/luatablegen/wasmheader.txt @@ -0,0 +1 @@ +#include "../wasm.h" diff --git a/bruiser/tablegen.sh b/bruiser/tablegen.sh new file mode 100755 index 0000000..5172d60 --- /dev/null +++ b/bruiser/tablegen.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash +cd $(dirname $0) +../extra-tools/luatablegen.py --tbg ./wasmtablegen.json --out ./luatablegen --luaheader ../lua-5.3.4/src --pre ./luatablegen/wasmheader.txt --headeraggr ./luatablegen/wasm_tables.h --lualibpath ./lua-scripts/wasm.lua +make -C ./luatablegen +make clean diff --git a/bruiser/wasmtablegen.json b/bruiser/wasmtablegen.json new file mode 100644 index 0000000..38fe5a7 --- /dev/null +++ b/bruiser/wasmtablegen.json @@ -0,0 +1,51 @@ +{ "init_expr_t": + {"field_name": ["size", "code"], "field_type": ["varuint32", "char*"], "lua_type": ["integer", "string"], "methods": ["convert", "check", "push_self", "push_args", "new"]}, + "resizable_limit_t": + {"field_name":["flags", "initial", "maximum"], "field_type": ["varuint1", "varuint32", "varuint32"], "lua_type": ["integer", "integer", "integer"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "global_type_t": + {"field_name": ["value_type", "mutability"], "field_type": ["enum value_type_t", "varuint1"], "lua_type":["integer", "integer"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "table_type_t": + {"field_name": ["element_type", "resizable_limit"],"field_type": ["varint7", "resizable_limit_t*"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "memory_type_t": + {"field_name":["resizable_limit"], "field_type":["resizable_limit_t*"], "lua_type":["lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Type_Section_Entry": + {"field_name": ["form", "param_count", "param_types", "return_count", "return_types"], "field_type":["varint7", "varuint32", "varint7*", "varuint1", "varint7*"], "lua_type":["integer", "integer", "lightuserdata", "integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args","new"]}, + "W_Type_Section": + {"field_name":["count", "entries"], "field_type": ["varuint32", "W_Type_Section_Entry**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Import_Section_Entry": + {"field_name":["module_length", "module_str", "field_len", "field_str", "kind", "type"], "field_type":["varuint32", "char*", "varuint32", "char*", "enum external_kind_t", "void*"], "lua_type": ["integer", "string", "integer", "string", "integer", "lightuserdata"], "methods": ["convert", "check", "push_self", "push_args", "new"]}, + "W_Import_Section": + {"field_name":["count", "entries"], "field_type":["varuint32","W_Import_Section**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Function_Section": + {"field_name":["count", "types"], "field_type":["varuint32", "varuint32*"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Table_Section": + {"field_name":["count", "entries"], "field_type":["varuint32", "table_type_t**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Memory_Section": + {"field_name":["count", "entries"], "field_type":["varuint32", "memory_type_t**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Global_Entry": + {"field_name":["type", "init"], "field_type":["global_type_t*", "init_expr_t*"], "lua_type":["lightuserdata", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Global_Section": + {"field_name":["count", "globals"], "field_type":["varuint32", "W_Global_Entry**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Export_Entry": + {"field_name":["field_len", "field_str", "kind", "index"], "field_type":["varuint32", "char*", "enum external_kind_t", "varuint32"], "lua_type":["integer", "string", "integer", "integer"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Export_Section": + {"field_name":["count", "entries"], "field_type": ["varuint32", "W_Export_Entry**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Start_Section": + {"field_name":["index"], "field_type":["varuint32"], "lua_type":["integer"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Elem_Segment": + {"field_name":["index", "offset", "num_length", "elems"], "field_type":["varuint32", "init_expr_t*", "varuint32", "varuint32*"], "lua_type":["integer", "lightuserdata", "integer", "integer"], "methods": ["convert", "check", "push_self", "push_args", "new"]}, + "W_Element_Section": + {"field_name":["count", "entries"], "field_type":["varuint32", "W_Elem_Segment**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Local_Entry": + {"field_name":["count", "type"], "field_type":["varuint32", "enum value_type_t"], "lua_type":["integer", "integer"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Function_Body": + {"field_name":["body_size", "local_count", "locals", "code"], "field_type":["varuint32", "varuint32", "W_Local_Entry**", "char*"], "lua_type":["integer", "integer", "lightuserdata", "string"], "methods": ["convert", "check", "push_self", "push_args", "new"]}, + "W_Code_Section": + {"field_name":["count", "bodies"], "field_type":["varuint32", "W_Function_Body**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Data_Segment": + {"field_name":["index", "offset", "size", "data"], "field_type":["varuint32", "init_expr_t*", "varuint32", "char*"], "lua_type":["integer", "lightuserdata", "integer", "string"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "W_Data_Section": + {"field_name": ["count", "entries"], "field_type":["varuint32", "W_Data_Segment**"], "lua_type":["integer", "lightuserdata"], "methods":["convert", "check", "push_self", "push_args", "new"]}, + "Wasm_Module": + {"field_name":["type_section", "import_section", "function_section", "table_section", "memory_section", "global_section", "export_section", "start_section", "element_section", "code_section", "data_section", "W_Custom_Sections", "name"], "field_type":["W_Type_Section*", "W_Import_Section*", "W_Function_Section*", "W_Table_Section*", "W_Memory_Section*", "W_Global_Section*", "W_Export_Section*", "W_Start_Section*", "W_Element_Section*", "W_Code_Section*", "W_Data_Section*", "void**", "char*"], "lua_type":["lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata", "lightuserdata","string"], "methods":["convert", "check", "push_self", "push_args", "new"]} +} |