lua_absindex

lua_absindex[-0, +0, –] int lua_absindex (lua_State *L, int idx); Converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top).

luaL_where

luaL_where[-0, +1, m] void luaL_where (lua_State *L, int lvl); Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack. Typically this string has the following format: chunkname:currentline: Level 0 is the running function, level 1 is the function that called the running function, etc. This function is used to build a prefix for error messages.

luaL_unref

luaL_unref[-0, +0, –] void luaL_unref (lua_State *L, int t, int ref); Releases reference ref from the table at index t (see luaL_ref). The entry is removed from the table, so that the referred object can be collected. The reference ref is also freed to be used again. If ref is LUA_NOREF or LUA_REFNIL, luaL_unref does nothing.

luaL_typename

luaL_typename[-0, +0, –] const char *luaL_typename (lua_State *L, int index); Returns the name of the type of the value at the given index.

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.

luaL_tolstring

luaL_tolstring[-0, +1, e] const char *luaL_tolstring (lua_State *L, int idx, size_t *len); Converts any Lua value at the given index to a C string in a reasonable format. The resulting string is pushed onto the stack and also returned by the function. If len is not NULL, the function also sets *len with the string length. If the value has a metatable with a __tostring field, then luaL_tolstring calls the corresponding metamethod with the value as argument, and uses the result of the call a

luaL_testudata

luaL_testudata[-0, +0, m] void *luaL_testudata (lua_State *L, int arg, const char *tname); This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error.

luaL_Stream

luaL_Stream typedef struct luaL_Stream { FILE *f; lua_CFunction closef; } luaL_Stream; The standard representation for file handles, which is used by the standard I/O library. A file handle is implemented as a full userdata, with a metatable called LUA_FILEHANDLE (where LUA_FILEHANDLE is a macro with the actual metatable's name). The metatable is created by the I/O library (see luaL_newmetatable). This userdata must start with the structure luaL_Stream; it can contain other data after

luaL_setmetatable

luaL_setmetatable[-0, +0, –] void luaL_setmetatable (lua_State *L, const char *tname); Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry (see luaL_newmetatable).

luaL_setfuncs

luaL_setfuncs[-nup, +0, m] void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup); Registers all functions in the array l (see luaL_Reg) into the table on the top of the stack (below optional upvalues, see next). When nup is not zero, all functions are created sharing nup upvalues, which must be previously pushed on the stack on top of the library table. These values are popped from the stack after the registration.