MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_setn

Function luaL_setn

lua/lauxlib.c:350–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349
350LUALIB_API void luaL_setn (lua_State *L, int t, int n) {
351 t = abs_index(L, t);
352 lua_pushliteral(L, "n");
353 lua_rawget(L, t);
354 if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */
355 lua_pushliteral(L, "n"); /* use it */
356 lua_pushinteger(L, n);
357 lua_rawset(L, t);
358 }
359 else { /* use `sizes' */
360 getsizes(L);
361 lua_pushvalue(L, t);
362 lua_pushinteger(L, n);
363 lua_rawset(L, -3); /* sizes[t] = n */
364 lua_pop(L, 1); /* remove `sizes' */
365 }
366}
367
368
369LUALIB_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