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

Function handle_script

src/Chain/libraries/glua/lua.cpp:435–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433
434
435static int handle_script(lua_State *L, char **argv) {
436 // READ THIS
437 int status;
438 const char *fname = argv[0];
439 if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
440 fname = nullptr; /* stdin */
441 status = luaL_loadfile(L, fname);
442 if (status == LUA_OK) {
443 int n = pushargs(L); /* push arguments to script */
444 status = docall(L, n, LUA_MULTRET);
445 }
446 return report(L, status);
447}
448
449
450

Callers 1

pmainFunction · 0.70

Calls 3

pushargsFunction · 0.70
docallFunction · 0.70
reportFunction · 0.70

Tested by

no test coverage detected