MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / dolibrary

Function dolibrary

3rd/lua-5.4.3/src/lua.c:213–221  ·  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

211** with the given name.
212*/
213static int dolibrary (lua_State *L, const char *name) {
214 int status;
215 lua_getglobal(L, "require");
216 lua_pushstring(L, name);
217 status = docall(L, 1, 1); /* call 'require(name)' */
218 if (status == LUA_OK)
219 lua_setglobal(L, name); /* global[name] = require return */
220 return report(L, status);
221}
222
223
224/*

Callers 1

runargsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected