From 83006367aeec856bf8e59231c78df5b1802e3138 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 17 May 2015 23:40:25 +0800 Subject: add addition and multiplication for cumatrix --- common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common.c') diff --git a/common.c b/common.c index f5521fd..c60c1ec 100644 --- a/common.c +++ b/common.c @@ -16,4 +16,12 @@ int nerv_error(lua_State *L, const char *err_mesg_fmt, ...) { int nerv_error_method_not_implemented(lua_State *L) { return nerv_error(L, "method not implemented"); } + +void luaN_append_methods(lua_State *L, const luaL_Reg *mlist) { + for (; mlist->func; mlist++) + { + lua_pushcfunction(L, mlist->func); + lua_setfield(L, -2, mlist->name); + } +} #endif -- cgit v1.2.3