lua_settable

lua_settable[-2, +0, e] void lua_settable (lua_State *L, int index); Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top. This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see §2.4).

lua_setmetatable

lua_setmetatable[-1, +0, –] void lua_setmetatable (lua_State *L, int index); Pops a table from the stack and sets it as the new metatable for the value at the given index.

lua_setlocal

lua_setlocal[-(0|1), +0, –] const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); Sets the value of a local variable of a given activation record. It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. Returns NULL (and pops nothing) when the index is greater than the number of active local variables. Parameters ar and n are as in function lua_getlocal.

lua_seti

lua_seti[-1, +0, e] void lua_seti (lua_State *L, int index, lua_Integer n); Does the equivalent to t[n] = v, where t is the value at the given index and v is the value at the top of the stack. This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see §2.4).

lua_sethook

lua_sethook[-0, +0, –] void lua_sethook (lua_State *L, lua_Hook f, int mask, int count); Sets the debugging hook function. Argument f is the hook function. mask specifies on which events the hook will be called: it is formed by a bitwise OR of the constants LUA_MASKCALL, LUA_MASKRET, LUA_MASKLINE, and LUA_MASKCOUNT. The count argument is only meaningful when the mask includes LUA_MASKCOUNT. For each event, the hook is called as explained below: The call hook: is called when the interpre

lua_setglobal

lua_setglobal[-1, +0, e] void lua_setglobal (lua_State *L, const char *name); Pops a value from the stack and sets it as the new value of global name.

lua_setfield

lua_setfield[-1, +0, e] void lua_setfield (lua_State *L, int index, const char *k); Does the equivalent to t[k] = v, where t is the value at the given index and v is the value at the top of the stack. This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see §2.4).

lua_setallocf

lua_setallocf[-0, +0, –] void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); Changes the allocator function of a given state to f with user data ud.

lua_rotate

lua_rotate[-0, +0, –] void lua_rotate (lua_State *L, int idx, int n); Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.

lua_resume

lua_resume[-?, +?, –] int lua_resume (lua_State *L, lua_State *from, int nargs); Starts and resumes a coroutine in the given thread L. To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. lua_resume ret