MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaL_setfuncs

Function luaL_setfuncs

emmy_debugger/src/api/lua_api_loader.cpp:304–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304void luaL_setfuncs(lua_State* L, const luaL_Reg* l, int nup)
305{
306 if (luaVersion == LuaVersion::LUA_51 || luaVersion == LuaVersion::LUA_JIT)
307 {
308 for (; l->name != nullptr; l++)
309 {
310 for (int i = 0; i < nup; i++)
311 lua_pushvalue(L, -nup);
312 lua_pushcclosure(L, l->func, nup);
313 lua_setfield(L, -(nup + 2), l->name);
314 }
315 }
316 else e_luaL_setfuncs(L, l, nup);
317}
318
319int lua_upvalueindex(int i)
320{

Callers

nothing calls this directly

Calls 3

lua_pushvalueFunction · 0.50
lua_pushcclosureFunction · 0.50
lua_setfieldFunction · 0.50

Tested by

no test coverage detected