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

Function tpack

third-party/lua-5.5.0/src/ltablib.c:192–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190*/
191
192static int tpack (lua_State *L) {
193 int i;
194 int n = lua_gettop(L); /* number of elements to pack */
195 lua_createtable(L, n, 1); /* create result table */
196 lua_insert(L, 1); /* put it at index 1 */
197 for (i = n; i >= 1; i--) /* assign elements */
198 lua_seti(L, 1, i);
199 lua_pushinteger(L, n);
200 lua_setfield(L, 1, "n"); /* t.n = number of elements */
201 return 1; /* return table */
202}
203
204
205static int tunpack (lua_State *L) {

Callers

nothing calls this directly

Calls 6

lua_gettopFunction · 0.70
lua_createtableFunction · 0.70
lua_setiFunction · 0.70
lua_pushintegerFunction · 0.70
lua_setfieldFunction · 0.70
lua_insertFunction · 0.50

Tested by

no test coverage detected