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

Function pushargs

src/Chain/libraries/glua/single_glua_src/main.cpp:438–448  ·  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

436** Push on the stack the contents of table 'arg' from 1 to #arg
437*/
438static int pushargs(lua_State *L) {
439 int i, n;
440 if (lua_getglobal(L, "arg") != LUA_TTABLE)
441 luaL_error(L, "'arg' is not a table");
442 n = (int)luaL_len(L, -1);
443 luaL_checkstack(L, n + 3, "too many arguments to script");
444 for (i = 1; i <= n; i++)
445 lua_rawgeti(L, -i, i);
446 lua_remove(L, -i); /* remove table from the stack */
447 return n;
448}
449
450static bool use_type_check_compile = true;
451

Callers 1

handle_scriptFunction · 0.70

Calls 4

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

Tested by

no test coverage detected