MCPcopy Create free account
hub / github.com/DFHack/dfhack / dolibrary

Function dolibrary

depends/lua/src/lua.c:259–267  ·  view source on GitHub ↗

** Calls 'require(name)' and stores the result in a global variable ** with the given name. */

Source from the content-addressed store, hash-verified

257** with the given name.
258*/
259static int dolibrary (lua_State *L, const char *name) {
260 int status;
261 lua_getglobal(L, "require");
262 lua_pushstring(L, name);
263 status = docall(L, 1, 1); /* call 'require(name)' */
264 if (status == LUA_OK)
265 lua_setglobal(L, name); /* global[name] = require return */
266 return report(L, status);
267}
268
269
270/*

Callers 1

runargsFunction · 0.85

Calls 5

lua_getglobalFunction · 0.85
lua_pushstringFunction · 0.85
docallFunction · 0.85
lua_setglobalFunction · 0.85
reportFunction · 0.70

Tested by

no test coverage detected