| 285 | |
| 286 | |
| 287 | static void getsizes (lua_State *L) { |
| 288 | lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); |
| 289 | if (lua_isnil(L, -1)) { /* no `size' table? */ |
| 290 | lua_pop(L, 1); /* remove nil */ |
| 291 | lua_newtable(L); /* create it */ |
| 292 | lua_pushvalue(L, -1); /* `size' will be its own metatable */ |
| 293 | lua_setmetatable(L, -2); |
| 294 | lua_pushliteral(L, "kv"); |
| 295 | lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ |
| 296 | lua_pushvalue(L, -1); |
| 297 | lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | |
| 302 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
no test coverage detected