| 333 | |
| 334 | |
| 335 | static void getsizes (lua_State *L) { |
| 336 | lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); |
| 337 | if (lua_isnil(L, -1)) { /* no `size' table? */ |
| 338 | lua_pop(L, 1); /* remove nil */ |
| 339 | lua_newtable(L); /* create it */ |
| 340 | lua_pushvalue(L, -1); /* `size' will be its own metatable */ |
| 341 | lua_setmetatable(L, -2); |
| 342 | lua_pushliteral(L, "kv"); |
| 343 | lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ |
| 344 | lua_pushvalue(L, -1); |
| 345 | lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | |
| 350 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
no test coverage detected