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

Function addtoclib

third-party/lua-5.5.0/src/loadlib.c:359–366  ·  view source on GitHub ↗

** registry.CLIBS[path] = plib -- for queries. ** Also create a reference to strlib, so that the library string will ** only be collected when registry.CLIBS is collected. */

Source from the content-addressed store, hash-verified

357** only be collected when registry.CLIBS is collected.
358*/
359static void addtoclib (lua_State *L, const char *path, void *plib) {
360 lua_getfield(L, LUA_REGISTRYINDEX, CLIBS);
361 lua_pushlightuserdata(L, plib);
362 lua_setfield(L, -2, path); /* CLIBS[path] = plib */
363 createlibstr(L, plib);
364 luaL_ref(L, -2); /* keep library string in CLIBS */
365 lua_pop(L, 1); /* pop CLIBS table */
366}
367
368
369/* error codes for 'lookforfunc' */

Callers 1

lookforfuncFunction · 0.70

Calls 5

createlibstrFunction · 0.85
lua_getfieldFunction · 0.70
lua_pushlightuserdataFunction · 0.70
lua_setfieldFunction · 0.70
luaL_refFunction · 0.70

Tested by

no test coverage detected