MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaL_setn

Function luaL_setn

Source/Misc/lua/src/lua.c:10514–10530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10512
10513
10514LUALIB_API void luaL_setn (lua_State *L, int t, int n) {
10515t = abs_index(L, t);
10516lua_pushliteral(L, "n");
10517lua_rawget(L, t);
10518if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */
10519lua_pushliteral(L, "n"); /* use it */
10520lua_pushinteger(L, n);
10521lua_rawset(L, t);
10522}
10523else { /* use `sizes' */
10524getsizes(L);
10525lua_pushvalue(L, t);
10526lua_pushinteger(L, n);
10527lua_rawset(L, -3); /* sizes[t] = n */
10528lua_pop(L, 1); /* remove `sizes' */
10529}
10530}
10531
10532
10533LUALIB_API int luaL_getn (lua_State *L, int t) {

Callers 3

setnFunction · 0.85
tinsertFunction · 0.85
tremoveFunction · 0.85

Calls 6

lua_rawgetFunction · 0.85
checkintFunction · 0.85
lua_pushintegerFunction · 0.85
lua_rawsetFunction · 0.85
getsizesFunction · 0.85
lua_pushvalueFunction · 0.85

Tested by

no test coverage detected