using namespace LUA;
extern "C" {
- int docall(lua_State * L, int narg, int clear, int perror);
+ int docall(lua_State * L, int narg, int nresults, int perror);
};
Session::Session():CoreSession()
arg_count++;
}
- docall(L, arg_count, 0, 1);
+ docall(L, arg_count, 1, 1);
const char *err = lua_tostring(L, -1);
arg_count++;
}
- docall(L, arg_count, 0, 1);
+ docall(L, arg_count, 1, 1);
ret = lua_tostring(L, -1);
lua_pop(L, 1);
arg_count++;
}
- docall(L, arg_count, 0, 1);
+ docall(L, arg_count, 1, 1);
ret = lua_tostring(L, -1);
lua_pop(L, 1);
lua_settable(lua_fun->L, -3);
}
- docall(lua_fun->L, 1, 0, 1);
+ docall(lua_fun->L, 1, 1, 1);
ret = lua_tonumber(lua_fun->L, -1);
lua_pop(lua_fun->L, 1);
return 1;
}
-int docall(lua_State * L, int narg, int clear, int perror)
+int docall(lua_State * L, int narg, int nresults, int perror)
{
int status;
int base = lua_gettop(L) - narg; /* function index */
lua_pushcfunction(L, traceback); /* push traceback function */
lua_insert(L, base); /* put it under chunk and args */
- status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
+ status = lua_pcall(L, narg, nresults, base);
lua_remove(L, base); /* remove traceback function */
/* force a complete garbage collection in case of errors */