luaL_optinteger

luaL_optinteger[-0, +0, v] lua_Integer luaL_optinteger (lua_State *L, int arg, lua_Integer d); If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d. Otherwise, raises an error.

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.

luaL_openlibs

luaL_openlibs[-0, +0, e] void luaL_openlibs (lua_State *L); Opens all standard Lua libraries into the given state.

luaL_newstate

luaL_newstate[-0, +0, –] lua_State *luaL_newstate (void); Creates a new Lua state. It calls lua_newstate with an allocator based on the standard C realloc function and then sets a panic function (see §4.6) that prints an error message to the standard error output in case of fatal errors. Returns the new state, or NULL if there is a memory allocation error.

luaL_newmetatable

luaL_newmetatable[-0, +1, m] int luaL_newmetatable (lua_State *L, const char *tname); If the registry already has the key tname, returns 0. Otherwise, creates a new table to be used as a metatable for userdata, adds to this new table the pair __name = tname, adds to the registry the pair [tname] = new table, and returns 1. (The entry __name is used by some error-reporting functions.) In both cases pushes onto the stack the final value associated with tname in the registry.

luaL_newlibtable

luaL_newlibtable[-0, +1, m] void luaL_newlibtable (lua_State *L, const luaL_Reg l[]); Creates a new table with a size optimized to store all entries in the array l (but does not actually store them). It is intended to be used in conjunction with luaL_setfuncs (see luaL_newlib). It is implemented as a macro. The array l must be the actual array, not a pointer to it.

luaL_newlib

luaL_newlib[-0, +1, m] void luaL_newlib (lua_State *L, const luaL_Reg l[]); Creates a new table and registers there the functions in list l. It is implemented as the following macro: (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) The array l must be the actual array, not a pointer to it.

luaL_loadstring

luaL_loadstring[-0, +1, –] int luaL_loadstring (lua_State *L, const char *s); Loads a string as a Lua chunk. This function uses lua_load to load the chunk in the zero-terminated string s. This function returns the same results as lua_load. Also as lua_load, this function only loads the chunk; it does not run it.

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

luaL_loadfile

luaL_loadfile[-0, +1, m] int luaL_loadfile (lua_State *L, const char *filename); Equivalent to luaL_loadfilex with mode equal to NULL.