| 2918 | |
| 2919 | |
| 2920 | LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { |
| 2921 | const char *name; |
| 2922 | TValue *val; |
| 2923 | StkId fi; |
| 2924 | lua_lock(L); |
| 2925 | fi = index2adr(L, funcindex); |
| 2926 | api_checknelems(L, 1); |
| 2927 | name = aux_upvalue(fi, n, &val); |
| 2928 | if (name) { |
| 2929 | L->top--; |
| 2930 | setobj(L, val, L->top); |
| 2931 | luaC_barrier(L, clvalue(fi), L->top); |
| 2932 | } |
| 2933 | lua_unlock(L); |
| 2934 | return name; |
| 2935 | } |
| 2936 | |
| 2937 | /* |
| 2938 | ** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ |
no test coverage detected