| 478 | } |
| 479 | |
| 480 | int LuaEnvironment::call(int narg, int nres) |
| 481 | { |
| 482 | int status; |
| 483 | int base = lua_gettop(L) - narg; /* function index */ |
| 484 | lua_pushcfunction(L, msghandler); /* push message handler */ |
| 485 | lua_insert(L, base); /* put it under function and args */ |
| 486 | status = lua_pcall(L, narg, nres, base); |
| 487 | lua_remove(L, base); /* remove message handler from the stack */ |
| 488 | return status; |
| 489 | } |
| 490 | |
| 491 | void LuaEnvironment::call_global(const char *func, ArgType::Enum *arg_types, Arg *args, int narg, int nres) |
| 492 | { |
no test coverage detected