diff options
author | bloodstalker <thabogre@gmail.com> | 2018-06-10 01:55:52 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-06-10 01:55:52 +0000 |
commit | c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0 (patch) | |
tree | c2b01bd58c150ce04771bd4da46b15d4411e217a /bruiser/luatablegen/W_Function_Section_tablegen.c | |
parent | the codegen is working now. the generated codes will not be part of the repo ... (diff) | |
download | mutator-c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0.tar.gz mutator-c0b9f25bebcecd1b5b42ce9248594f05f82b9fc0.zip |
added the autogen files, should also fix travis
Diffstat (limited to 'bruiser/luatablegen/W_Function_Section_tablegen.c')
-rw-r--r-- | bruiser/luatablegen/W_Function_Section_tablegen.c | 114 |
1 files changed, 114 insertions, 0 deletions
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 + + |