diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 23 |
1 files changed, 1 insertions, 22 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.289 2018/02/27 17:48:28 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.290 2018/02/27 20:01:55 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -705,27 +705,6 @@ LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) { | |||
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | 707 | ||
| 708 | static int auxkeydef (lua_State *L, int idx, int remove) { | ||
| 709 | int res; | ||
| 710 | lua_lock(L); | ||
| 711 | api_checknelems(L, 1); | ||
| 712 | res = luaT_keydef(L, index2value(L, idx), s2v(L->top - 1), remove); | ||
| 713 | L->top--; /* remove key */ | ||
| 714 | lua_unlock(L); | ||
| 715 | return res; | ||
| 716 | } | ||
| 717 | |||
| 718 | |||
| 719 | LUA_API void lua_removekey (lua_State *L, int idx) { | ||
| 720 | auxkeydef(L, idx, 1); | ||
| 721 | } | ||
| 722 | |||
| 723 | |||
| 724 | LUA_API int lua_keyin (lua_State *L, int idx) { | ||
| 725 | return auxkeydef(L, idx, 0); | ||
| 726 | } | ||
| 727 | |||
| 728 | |||
| 729 | LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { | 708 | LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { |
| 730 | Table *t; | 709 | Table *t; |
| 731 | lua_lock(L); | 710 | lua_lock(L); |
