MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / createclibstable

Function createclibstable

libraries/AP_Scripting/lua/src/loadlib.c:785–792  ·  view source on GitHub ↗

** create table CLIBS to keep track of loaded C libraries, ** setting a finalizer to close all libraries when closing state. */

Source from the content-addressed store, hash-verified

783** setting a finalizer to close all libraries when closing state.
784*/
785static void createclibstable (lua_State *L) {
786 lua_newtable(L); /* create CLIBS table */
787 lua_createtable(L, 0, 1); /* create metatable for CLIBS */
788 lua_pushcfunction(L, gctm);
789 lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */
790 lua_setmetatable(L, -2);
791 lua_rawsetp(L, LUA_REGISTRYINDEX, &CLIBS); /* set CLIBS table in registry */
792}
793#endif
794
795LUAMOD_API int luaopen_package (lua_State *L) {

Callers

nothing calls this directly

Calls 4

lua_createtableFunction · 0.85
lua_setfieldFunction · 0.85
lua_setmetatableFunction · 0.85
lua_rawsetpFunction · 0.85

Tested by

no test coverage detected