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

Function handle_script

depends/lua/src/lua.c:437–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

pmainFunction · 0.85

Calls 3

pushargsFunction · 0.85
docallFunction · 0.85
reportFunction · 0.70

Tested by

no test coverage detected