| 348 | |
| 349 | |
| 350 | LUALIB_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 | |
| 369 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
no test coverage detected