| 11658 | |
| 11659 | |
| 11660 | static int db_getlocal (lua_State *L) { |
| 11661 | int arg; |
| 11662 | lua_State *L1 = getthread(L, &arg); |
| 11663 | lua_Debug ar; |
| 11664 | const char *name; |
| 11665 | if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ |
| 11666 | return luaL_argerror(L, arg+1, "level out of range"); |
| 11667 | name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2)); |
| 11668 | if (name) { |
| 11669 | lua_xmove(L1, L, 1); |
| 11670 | lua_pushstring(L, name); |
| 11671 | lua_pushvalue(L, -2); |
| 11672 | return 2; |
| 11673 | } |
| 11674 | else { |
| 11675 | lua_pushnil(L); |
| 11676 | return 1; |
| 11677 | } |
| 11678 | } |
| 11679 | |
| 11680 | |
| 11681 | static int db_setlocal (lua_State *L) { |
nothing calls this directly
no test coverage detected