LUA_GETLOCAL(3) | Library Functions Manual | LUA_GETLOCAL(3) |
lua_getlocal
—
gets information about a local variable of a given
activation record, function indicator [-0, + (0|1), -]
#include
<lua.h>
const char *
lua_getlocal
(lua_State
*L, lua_Debug *ar,
int n);
lua_getlocal
()
gets information about a local variable of a given activation record. The
parameter ar must be a valid activation record that
was filled by a previous call to
lua_getstack
()
or given as argument to a hook (see lua_Hook(3) ). The
index n selects which local variable to inspect (1 is
the first parameter or active local variable, and so on, until the last
active local variable). lua_getlocal
() pushes the
variable's value onto the stack and returns its name.
Variable names starting with '(' (open parentheses) represent internal variables (loop control variables, temporaries, and C function locals).
Returns NULL
(and pushes nothing) when the
index is greater than the number of active local variables.
Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, Lua 5.1 Reference Manual.
The lua_getlocal
() manual page is based on
Lua Reference Manual 5.1 and was created by Sergey Bronnikov.
July 13, 2022 | Debian |