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.

string.char()

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

xpcall()

xpcall (f, msgh [, arg1, ···]) This function is similar to pcall, except that it sets a new message handler msgh.

lua_tothread

lua_tothread[-0, +0, –] lua_State *lua_tothread (lua_State *L, int index); Converts the value at the given index to a Lua thread (represented as lua_State*). This value must be a thread; otherwise, the function returns NULL.

io.output()

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

luaL_callmeta

luaL_callmeta[-0, +(0|1), e] int luaL_callmeta (lua_State *L, int obj, const char *e); Calls a metamethod. If the object at index obj has a metatable and this metatable has a field e, this function calls this field passing the object as its only argument. In this case this function returns true and pushes onto the stack the value returned by the call. If there is no metatable or no metamethod, this function returns false (without pushing any value on the stack).

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.

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

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.

luaL_addstring

luaL_addstring[-?, +?, m] void luaL_addstring (luaL_Buffer *B, const char *s); Adds the zero-terminated string pointed to by s to the buffer B (see luaL_Buffer).