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

Function dolibrary

src/Chain/libraries/glua/single_glua_src/main.cpp:230–238  ·  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

228** with the given name.
229*/
230static int dolibrary(lua_State *L, const char *name) {
231 int status;
232 lua_getglobal(L, "require");
233 lua_pushstring(L, name);
234 status = docall(L, 1, 1); /* call 'require(name)' */
235 if (status == LUA_OK)
236 lua_setglobal(L, name); /* global[name] = require return */
237 return report(L, status);
238}
239
240/*
241** Returns the string to be used as a prompt by the interpreter.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected