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

Function pushargs

depends/lua/src/lua.c:424–434  ·  view source on GitHub ↗

** Push on the stack the contents of table 'arg' from 1 to #arg */

Source from the content-addressed store, hash-verified

422** Push on the stack the contents of table 'arg' from 1 to #arg
423*/
424static int pushargs (lua_State *L) {
425 int i, n;
426 if (lua_getglobal(L, "arg") != LUA_TTABLE)
427 luaL_error(L, "'arg' is not a table");
428 n = (int)luaL_len(L, -1);
429 luaL_checkstack(L, n + 3, "too many arguments to script");
430 for (i = 1; i <= n; i++)
431 lua_rawgeti(L, -i, i);
432 lua_remove(L, -i); /* remove table from the stack */
433 return n;
434}
435
436
437static int handle_script (lua_State *L, char **argv) {

Callers 1

handle_scriptFunction · 0.85

Calls 4

lua_getglobalFunction · 0.85
luaL_errorFunction · 0.85
luaL_checkstackFunction · 0.85
lua_rawgetiFunction · 0.85

Tested by

no test coverage detected