MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / getargs

Function getargs

third-party/lua-5.2.4/src/lua.c:192–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190
191
192static int getargs (lua_State *L, char **argv, int n) {
193 int narg;
194 int i;
195 int argc = 0;
196 while (argv[argc]) argc++; /* count total number of arguments */
197 narg = argc - (n + 1); /* number of arguments to the script */
198 luaL_checkstack(L, narg + 3, "too many arguments to script");
199 for (i=n+1; i < argc; i++)
200 lua_pushstring(L, argv[i]);
201 lua_createtable(L, narg, n + 1);
202 for (i=0; i < argc; i++) {
203 lua_pushstring(L, argv[i]);
204 lua_rawseti(L, -2, i - n);
205 }
206 return narg;
207}
208
209
210static int dofile (lua_State *L, const char *name) {

Callers 1

handle_scriptFunction · 0.70

Calls 4

luaL_checkstackFunction · 0.70
lua_pushstringFunction · 0.70
lua_createtableFunction · 0.70
lua_rawsetiFunction · 0.70

Tested by

no test coverage detected