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

luaL_checkstack[-0, +0, v] void luaL_checkstack (lua_State *L, int sz, const char *msg); Grows the stack size to top + sz elements, raising an error if the stack cannot grow to that size. msg is an additional text to go into the error message (or NULL for no additional text).

luaL_checkoption

luaL_checkoption[-0, +0, v] int luaL_checkoption (lua_State *L, int arg, const char *def, const char *const lst[]); Checks whether the function argument arg is a string and searches for this string in the array lst (which must be NULL-terminated). Returns the index in the array where the string was found. Raises an error if the argument is not a string or if the string cannot be found. If def is not NULL, the function uses d

luaL_checknumber

luaL_checknumber[-0, +0, v] lua_Number luaL_checknumber (lua_State *L, int arg); Checks whether the function argument arg is a number and returns this number.

luaL_checklstring

luaL_checklstring[-0, +0, v] const char *luaL_checklstring (lua_State *L, int arg, size_t *l); Checks whether the function argument arg is a string and returns this string; if l is not NULL fills *l with the string's length. This function uses lua_tolstring to get its result, so all conversions and caveats of that function apply here.

luaL_checkinteger

luaL_checkinteger[-0, +0, v] lua_Integer luaL_checkinteger (lua_State *L, int arg); Checks whether the function argument arg is an integer (or can be converted to an integer) and returns this integer cast to a lua_Integer.

luaL_checkany

luaL_checkany[-0, +0, v] void luaL_checkany (lua_State *L, int arg); Checks whether the function has an argument of any type (including nil) at position arg.

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