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.

luaL_prepbuffer

luaL_prepbuffer[-?, +?, m] char *luaL_prepbuffer (luaL_Buffer *B); Equivalent to luaL_prepbuffsize with the predefined size LUAL_BUFFERSIZE.

debug.setlocal()

debug.setlocal ([thread,] level, local, value) This function assigns the value value to the local variable with index local of the function at level level of the stack. The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call getinfo to check whether the level is valid.) Otherwise, it returns the name of the local variable. See debug.getlocal for more information about variable indices and names.

getmetatable()

getmetatable (object) If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a __metatable field, returns the associated value. Otherwise, returns the metatable of the given object.

lua_pushcfunction

lua_pushcfunction[-0, +1, –] void lua_pushcfunction (lua_State *L, lua_CFunction f); Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see lua_CFunction).

luaL_opt

luaL_opt[-0, +0, e] T luaL_opt (L, func, arg, dflt); This macro is defined as follows: (lua_isnoneornil(L,(arg)) ? (dflt) : func(L,(arg))) In words, if the argument arg is nil or absent, the macro results in the default dflt. Otherwise, it results in the result of calling func with the state L and the argument index arg as parameters. Note that it evaluates the expression dflt only if needed.

io.output()

io.output ([file]) Similar to io.input, but operates over the default output file.

string.char()

string.char (···) Numeric codes are not necessarily portable across platforms.

luaL_traceback

luaL_traceback[-0, +1, m] void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, int level); Creates and pushes a traceback of the stack L1. If msg is not NULL it is appended at the beginning of the traceback. The level parameter tells at which level to start the traceback.

table.pack()

table.pack (···) Returns a new table with all parameters stored into keys 1, 2, etc. and with a field "n" with the total number of parameters. Note that the resulting table may not be a sequence.