MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / handle_script

Function handle_script

extlibs/lua/src/lua.c:219–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217
218
219static int handle_script (lua_State *L, char **argv) {
220 int status;
221 const char *fname = argv[0];
222 if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
223 fname = NULL; /* stdin */
224 status = luaL_loadfile(L, fname);
225 if (status == LUA_OK) {
226 int n = pushargs(L); /* push arguments to script */
227 status = docall(L, n, LUA_MULTRET);
228 }
229 return report(L, status);
230}
231
232
233/* bits of various argument indicators in 'args' */

Callers 1

pmainFunction · 0.85

Calls 3

pushargsFunction · 0.85
docallFunction · 0.85
reportFunction · 0.85

Tested by

no test coverage detected