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

Function tpack

third-party/lua-5.4.6/src/ltablib.c:181–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179*/
180
181static int tpack (lua_State *L) {
182 int i;
183 int n = lua_gettop(L); /* number of elements to pack */
184 lua_createtable(L, n, 1); /* create result table */
185 lua_insert(L, 1); /* put it at index 1 */
186 for (i = n; i >= 1; i--) /* assign elements */
187 lua_seti(L, 1, i);
188 lua_pushinteger(L, n);
189 lua_setfield(L, 1, "n"); /* t.n = number of elements */
190 return 1; /* return table */
191}
192
193
194static 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