aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/wasm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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) {