MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / addtoclib

Function addtoclib

ThirdParty/lua/lua/loadlib.c:291–298  ·  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

289** registry.CLIBS[#CLIBS + 1] = plib -- also keep a list of all libraries
290*/
291static void addtoclib (lua_State *L, const char *path, void *plib) {
292 lua_rawgetp(L, LUA_REGISTRYINDEX, &CLIBS);
293 lua_pushlightuserdata(L, plib);
294 lua_pushvalue(L, -1);
295 lua_setfield(L, -3, path); /* CLIBS[path] = plib */
296 lua_rawseti(L, -2, luaL_len(L, -2) + 1); /* CLIBS[#CLIBS + 1] = plib */
297 lua_pop(L, 1); /* pop CLIBS table */
298}
299
300
301/*

Callers 1

lookforfuncFunction · 0.85

Calls 5

lua_rawgetpFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85
lua_rawsetiFunction · 0.85

Tested by

no test coverage detected