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

Function pushargs

src/Chain/libraries/glua/lrepl.cpp:141–151  ·  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

139** Push on the stack the contents of table 'arg' from 1 to #arg
140*/
141static int pushargs(lua_State *L) {
142 int i, n;
143 if (lua_getglobal(L, "arg") != LUA_TTABLE)
144 luaL_error(L, "'arg' is not a table");
145 n = (int)luaL_len(L, -1);
146 luaL_checkstack(L, n + 3, "too many arguments to script");
147 for (i = 1; i <= n; i++)
148 lua_rawgeti(L, -i, i);
149 lua_remove(L, -i); /* remove table from the stack */
150 return n;
151}
152
153
154

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