MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaL_setn

Function luaL_setn

other_src/lua/src/lauxlib.cpp:327–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325
326
327LUALIB_API void luaL_setn (lua_State *L, int t, int n) {
328 t = abs_index(L, t);
329 lua_pushliteral(L, "n");
330 lua_rawget(L, t);
331 if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */
332 lua_pushliteral(L, "n"); /* use it */
333 lua_pushinteger(L, n);
334 lua_rawset(L, t);
335 }
336 else { /* use `sizes' */
337 getsizes(L);
338 lua_pushvalue(L, t);
339 lua_pushinteger(L, n);
340 lua_rawset(L, -3); /* sizes[t] = n */
341 lua_pop(L, 1); /* remove `sizes' */
342 }
343}
344
345
346LUALIB_API int luaL_getn (lua_State *L, int t) {

Callers 3

setnFunction · 0.70
tinsertFunction · 0.70
tremoveFunction · 0.70

Calls 6

lua_rawgetFunction · 0.70
checkintFunction · 0.70
lua_pushintegerFunction · 0.70
lua_rawsetFunction · 0.70
getsizesFunction · 0.70
lua_pushvalueFunction · 0.70

Tested by

no test coverage detected