| 172 | |
| 173 | |
| 174 | LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { |
| 175 | StkId pos = 0; /* to avoid warnings */ |
| 176 | const char *name; |
| 177 | lua_lock(L); |
| 178 | swapextra(L); |
| 179 | name = findlocal(L, ar->i_ci, n, &pos); |
| 180 | if (name) |
| 181 | setobjs2s(L, pos, L->top - 1); |
| 182 | L->top--; /* pop value */ |
| 183 | swapextra(L); |
| 184 | lua_unlock(L); |
| 185 | return name; |
| 186 | } |
| 187 | |
| 188 | |
| 189 | static void funcinfo (lua_Debug *ar, Closure *cl) { |