aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/wasm.c
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-06-04 00:13:03 +0000
committerbloodstalker <thabogre@gmail.com>2018-06-04 00:13:03 +0000
commitefae8398853d1494a17351f855e261867922ba44 (patch)
tree049d49c9f8a4fa58b42d36804035de6f6e82c39b /bruiser/wasm.c
parentfixed a bug with default.lua. added the blueprint for the wasm interface to b... (diff)
downloadmutator-efae8398853d1494a17351f855e261867922ba44.tar.gz
mutator-efae8398853d1494a17351f855e261867922ba44.zip
fixes #40
Diffstat (limited to 'bruiser/wasm.c')
-rw-r--r--bruiser/wasm.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/bruiser/wasm.c b/bruiser/wasm.c
index ac5143c..c517269 100644
--- a/bruiser/wasm.c
+++ b/bruiser/wasm.c
@@ -21,8 +21,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
#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 "wasm.h"
+#include "./wasm.h"
/**********************************************************************************************************************/
+static Wasm_Module* convert_wasm_module(lua_State* ls, int index) {
+ Wasm_Module* dummy = lua_touserdata(ls, index);
+ if (dummy == NULL) {printf("convert_wasm_module: bad userdata.\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("check_wasm_module: bad userdata.\n");}
+ return dummy;
+}
#pragma weak main
int main(int argc, char** argv) {