MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / addtoclib

Function addtoclib

src/Chain/libraries/glua/loadlib.cpp:297–304  ·  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

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

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