** 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. */
| 357 | ** only be collected when registry.CLIBS is collected. |
| 358 | */ |
| 359 | static 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' */ |
no test coverage detected