lua_gettop

lua_gettop[-0, +0, –] int lua_gettop (lua_State *L); Returns the index of the top element in the stack. Because indices start at 1, this result is equal to the number of elements in the stack; in particular, 0 means an empty stack.

lua_gettable

lua_gettable[-1, +1, e] int lua_gettable (lua_State *L, int index); Pushes onto the stack the value t[k], where t is the value at the given index and k is the value at the top of the stack. This function pops the key from the stack, pushing the resulting value in its place. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). Returns the type of the pushed value.

lua_getstack

lua_getstack[-0, +0, –] int lua_getstack (lua_State *L, int level, lua_Debug *ar); Gets information about the interpreter runtime stack. This function fills parts of a lua_Debug structure with an identification of the activation record of the function executing at a given level. Level 0 is the current running function, whereas level n+1 is the function that has called level n (except for tail calls, which do not count on the stack). When there are no errors, lua_getstack returns 1; when ca

lua_getmetatable

lua_getmetatable[-0, +(0|1), –] int lua_getmetatable (lua_State *L, int index); If the value at the given index has a metatable, the function pushes that metatable onto the stack and returns 1. Otherwise, the function returns 0 and pushes nothing on the stack.

lua_getlocal

lua_getlocal[-0, +(0|1), –] const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); Gets information about a local variable of a given activation record or a given function. In the first case, 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). The index n selects which local variable to inspect; see debug.getlocal for details about variable indices and names. lua_getlocal pushes

lua_getinfo

lua_getinfo[-(0|1), +(0|1|2), e] int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); Gets information about a specific function or function invocation. To get information about a function invocation, 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). To get information about a function you push it onto the stack and start the what string with the character '>'. (In that case,

lua_geti

lua_geti[-0, +1, e] int lua_geti (lua_State *L, int index, lua_Integer i); Pushes onto the stack the value t[i], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). Returns the type of the pushed value.

lua_gethookmask

lua_gethookmask[-0, +0, –] int lua_gethookmask (lua_State *L); Returns the current hook mask.

lua_gethookcount

lua_gethookcount[-0, +0, –] int lua_gethookcount (lua_State *L); Returns the current hook count.

lua_gethook

lua_gethook[-0, +0, –] lua_Hook lua_gethook (lua_State *L); Returns the current hook function.