MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / addtoclib

Function addtoclib

3rd/lua-5.4.3/src/loadlib.c:349–356  ·  view source on GitHub ↗

** registry.CLIBS[path] = plib -- for queries ** registry.CLIBS[#CLIBS + 1] = plib -- also keep a list of all libraries */

Source from the content-addressed store, hash-verified

347** registry.CLIBS[#CLIBS + 1] = plib -- also keep a list of all libraries
348*/
349static void addtoclib (lua_State *L, const char *path, void *plib) {
350 lua_getfield(L, LUA_REGISTRYINDEX, CLIBS);
351 lua_pushlightuserdata(L, plib);
352 lua_pushvalue(L, -1);
353 lua_setfield(L, -3, path); /* CLIBS[path] = plib */
354 lua_rawseti(L, -2, luaL_len(L, -2) + 1); /* CLIBS[#CLIBS + 1] = plib */
355 lua_pop(L, 1); /* pop CLIBS table */
356}
357
358
359/*

Callers 1

lookforfuncFunction · 0.85

Calls 6

lua_getfieldFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85
lua_rawsetiFunction · 0.85
luaL_lenFunction · 0.85

Tested by

no test coverage detected