luaL_ref

luaL_ref[-1, +0, m] int luaL_ref (lua_State *L, int t); Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). A reference is a unique integer key. As long as you do not manually add integer keys into table t, luaL_ref ensures the uniqueness of the key it returns. You can retrieve an object referred by reference r by calling lua_rawgeti(L, t, r). Function luaL_unref frees a reference and its associated object. If the object

luaL_loadfilex

luaL_loadfilex[-0, +1, m] int luaL_loadfilex (lua_State *L, const char *filename, const char *mode); Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename. If filename is NULL, then it loads from the standard input. The first line in the file is ignored if it starts with a #. The string mode works as in function lua_load. This function returns the same results as lua_load, but it has an extra erro

string.dump()

string.dump (function [, strip]) Returns a string containing a binary representation (a binary chunk) of the given function, so that a later load on this string returns a copy of the function (but with new upvalues). If strip is a true value, the binary representation may not include all debug information about the function, to save space. Functions with upvalues have only their number of upvalues saved. When (re)loaded, those upvalues receive fresh instances containing nil. (You can use th

lua_arith

lua_arith[-(2|1), +1, e] void lua_arith (lua_State *L, int op); Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). The value of op must be one of the following constants: LUA_OPADD: performs addition (+

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_pushnumber

lua_pushnumber[-0, +1, –] void lua_pushnumber (lua_State *L, lua_Number n); Pushes a float with value n onto the stack.

debug.getupvalue()

debug.getupvalue (f, up) This function returns the name and the value of the upvalue with index up of the function f. The function returns nil if there is no upvalue with the given index. Variable names starting with '(' (open parenthesis) represent variables with no known names (variables from chunks saved without debug information).

io.flush()

io.flush () Equivalent to io.output():flush().

luaL_buffinitsize

luaL_buffinitsize[-?, +?, m] char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz); Equivalent to the sequence luaL_buffinit, luaL_prepbuffsize.

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.