MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / handle_script

Function handle_script

lib/lua/src/lua.c:257–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255
256
257static int handle_script (lua_State *L, char **argv) {
258 int status;
259 const char *fname = argv[0];
260 if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
261 fname = NULL; /* stdin */
262 status = luaL_loadfile(L, fname);
263 if (status == LUA_OK) {
264 int n = pushargs(L); /* push arguments to script */
265 status = docall(L, n, LUA_MULTRET);
266 }
267 return report(L, status);
268}
269
270
271/* 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