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

luaL_requiref

luaL_requiref[-0, +1, e] void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb); If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require. If glb is true, also stores the module into global modname. Leaves a copy of the module on the stack.

luaL_Reg

luaL_Reg typedef struct luaL_Reg { const char *name; lua_CFunction func; } luaL_Reg; Type for arrays of functions to be registered by luaL_setfuncs. name is the function name and func is a pointer to the function. Any array of luaL_Reg must end with a sentinel entry in which both name and func are NULL.

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