lua_rawseti

lua_rawseti[-1, +0, m] void lua_rawseti (lua_State *L, int index, lua_Integer i); Does the equivalent of t[i] = v, where t is the table at the given index and v is the value at the top of the stack. This function pops the value from the stack. The assignment is raw, that is, it does not invoke the __newindex metamethod.

lua_rawsetp

lua_rawsetp[-1, +0, m] void lua_rawsetp (lua_State *L, int index, const void *p); Does the equivalent of t[p] = v, where t is the table at the given index, p is encoded as a light userdata, and v is the value at the top of the stack. This function pops the value from the stack. The assignment is raw, that is, it does not invoke __newindex metamethod.

lua_Reader

lua_Reader typedef const char * (*lua_Reader) (lua_State *L, void *data, size_t *size); The reader function used by lua_load. Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size. The block must exist until the reader function is called again. To signal

lua_register

lua_register[-0, +0, e] void lua_register (lua_State *L, const char *name, lua_CFunction f); Sets the C function f as the new value of global name. It is defined as a macro: #define lua_register(L,n,f) \ (lua_pushcfunction(L, f), lua_setglobal(L, n))

lua_remove

lua_remove[-1, +0, –] void lua_remove (lua_State *L, int index); Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.

lua_replace

lua_replace[-1, +0, –] void lua_replace (lua_State *L, int index); Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element.

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

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_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_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).