diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 24 |
1 files changed, 2 insertions, 22 deletions
| @@ -695,28 +695,7 @@ LUA_API void lua_newuserdatabox (lua_State *L, void *p) { | |||
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | 697 | ||
| 698 | LUA_API int lua_getweakmode (lua_State *L, int index) { | 698 | LUA_API int lua_pushupvalues (lua_State *L) { |
| 699 | StkId t; | ||
| 700 | int mode; | ||
| 701 | lua_lock(L); | ||
| 702 | t = luaA_index(L, index); | ||
| 703 | api_check(L, ttype(t) == LUA_TTABLE); | ||
| 704 | mode = hvalue(t)->weakmode; | ||
| 705 | lua_unlock(L); | ||
| 706 | return mode; | ||
| 707 | } | ||
| 708 | |||
| 709 | |||
| 710 | LUA_API void lua_setweakmode (lua_State *L, int mode) { | ||
| 711 | lua_lock(L); | ||
| 712 | api_check(L, ttype(L->top-1) == LUA_TTABLE); | ||
| 713 | hvalue(L->top-1)->weakmode = cast(lu_byte, mode); | ||
| 714 | lua_unlock(L); | ||
| 715 | } | ||
| 716 | |||
| 717 | |||
| 718 | |||
| 719 | LUA_API void lua_pushupvalues (lua_State *L) { | ||
| 720 | TObject *func; | 699 | TObject *func; |
| 721 | int n, i; | 700 | int n, i; |
| 722 | lua_lock(L); | 701 | lua_lock(L); |
| @@ -730,6 +709,7 @@ LUA_API void lua_pushupvalues (lua_State *L) { | |||
| 730 | L->top++; | 709 | L->top++; |
| 731 | } | 710 | } |
| 732 | lua_unlock(L); | 711 | lua_unlock(L); |
| 712 | return n; | ||
| 733 | } | 713 | } |
| 734 | 714 | ||
| 735 | 715 | ||
