luaL_checkstring

luaL_checkstring[-0, +0, v] const char *luaL_checkstring (lua_State *L, int arg); Checks whether the function argument arg is a string and returns this string. This function uses lua_tolstring to get its result, so all conversions and caveats of that function apply here.

luaL_checktype

luaL_checktype[-0, +0, v] void luaL_checktype (lua_State *L, int arg, int t); Checks whether the function argument arg has type t. See lua_type for the encoding of types for t.

luaL_checkudata

luaL_checkudata[-0, +0, v] void *luaL_checkudata (lua_State *L, int arg, const char *tname); Checks whether the function argument arg is a userdata of the type tname (see luaL_newmetatable) and returns the userdata address (see lua_touserdata).

luaL_checkversion

luaL_checkversion[-0, +0, v] void luaL_checkversion (lua_State *L); Checks whether the core running the call, the core that created the Lua state, and the code making the call are all using the same version of Lua. Also checks whether the core running the call and the core that created the Lua state are using the same address space.

luaL_dofile

luaL_dofile[-0, +?, e] int luaL_dofile (lua_State *L, const char *filename); Loads and runs the given file. It is defined as the following macro: (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0)) It returns false if there are no errors or true in case of errors.

luaL_dostring

luaL_dostring[-0, +?, –] int luaL_dostring (lua_State *L, const char *str); Loads and runs the given string. It is defined as the following macro: (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) It returns false if there are no errors or true in case of errors.

luaL_error

luaL_error[-0, +0, v] int luaL_error (lua_State *L, const char *fmt, ...); Raises an error. The error message format is given by fmt plus any extra arguments, following the same rules of lua_pushfstring. It also adds at the beginning of the message the file name and the line number where the error occurred, if this information is available. This function never returns, but it is an idiom to use it in C functions as return luaL_error(args).

luaL_execresult

luaL_execresult[-0, +3, m] int luaL_execresult (lua_State *L, int stat); This function produces the return values for process-related functions in the standard library (os.execute and io.close).

luaL_fileresult

luaL_fileresult[-0, +(1|3), m] int luaL_fileresult (lua_State *L, int stat, const char *fname); This function produces the return values for file-related functions in the standard library (io.open, os.rename, file:seek, etc.).

luaL_getmetafield

luaL_getmetafield[-0, +(0|1), m] int luaL_getmetafield (lua_State *L, int obj, const char *e); Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of pushed value. If the object does not have a metatable, or if the metatable does not have this field, pushes nothing and returns LUA_TNIL.