MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / createclibstable

Function createclibstable

extlibs/lua/src/loadlib.c:722–728  ·  view source on GitHub ↗

** create table CLIBS to keep track of loaded C libraries, ** setting a finalizer to close all libraries when closing state. */

Source from the content-addressed store, hash-verified

720** setting a finalizer to close all libraries when closing state.
721*/
722static void createclibstable (lua_State *L) {
723 luaL_getsubtable(L, LUA_REGISTRYINDEX, CLIBS); /* create CLIBS table */
724 lua_createtable(L, 0, 1); /* create metatable for CLIBS */
725 lua_pushcfunction(L, gctm);
726 lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */
727 lua_setmetatable(L, -2);
728}
729
730
731LUAMOD_API int luaopen_package (lua_State *L) {

Callers 1

luaopen_packageFunction · 0.85

Calls 4

lua_createtableFunction · 0.85
lua_setfieldFunction · 0.85
lua_setmetatableFunction · 0.85
luaL_getsubtableFunction · 0.70

Tested by

no test coverage detected