static int luaB_dofile (lua_State *L) { const char *fname = luaL_optstring(L, 1, NULL); lua_settop(L, 1); if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L); lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); return dofilecont(L); }
static int luaB_dofile (lua_State *L) { const char *fname = luaL_optstring(L, 1, NULL); lua_settop(L, 1); #if defined( LUA_USES_LOADF ) if (luaL_loadfile(L, fname) != LUA_OK) return lua_error(L); #else if (luaL_loadfsfile(L, fname) != LUA_OK) return lua_error(L); #endif lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); return dofilecont(L, 0, 0); }
void luacall(std::ptrdiff_t argcount, std::ptrdiff_t resultcount) const { lua_callk(base_t::lua_state(), static_cast<int>(argcount), static_cast<int>(resultcount), 0, nullptr); }