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

luaL_buffinitsize

luaL_buffinitsize[-?, +?, m] char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz); Equivalent to the sequence luaL_buffinit, luaL_prepbuffsize.

luaL_buffinit

luaL_buffinit[-0, +0, –] void luaL_buffinit (lua_State *L, luaL_Buffer *B); Initializes a buffer B. This function does not allocate any space; the buffer must be declared as a variable (see luaL_Buffer).

luaL_Buffer

luaL_Buffer typedef struct luaL_Buffer luaL_Buffer; Type for a string buffer. A string buffer allows C code to build Lua strings piecemeal. Its pattern of use is as follows: First declare a variable b of type luaL_Buffer. Then initialize it with a call luaL_buffinit(L, &b). Then add string pieces to the buffer calling any of the luaL_add* functions. Finish by calling luaL_pushresult(&b). This call leaves the final string on the top of the stack. If you know beforehand the to

luaL_argerror

luaL_argerror[-0, +0, v] int luaL_argerror (lua_State *L, int arg, const char *extramsg); Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: bad argument #arg to 'funcname' (extramsg) This function never returns.

luaL_argcheck

luaL_argcheck[-0, +0, v] void luaL_argcheck (lua_State *L, int cond, int arg, const char *extramsg); Checks whether cond is true. If it is not, raises an error with a standard message (see luaL_argerror).

luaL_addvalue

luaL_addvalue[-1, +?, m] void luaL_addvalue (luaL_Buffer *B); Adds the value at the top of the stack to the buffer B (see luaL_Buffer). Pops the value. This is the only function on string buffers that can (and must) be called with an extra element on the stack, which is the value to be added to the buffer.

luaL_addstring

luaL_addstring[-?, +?, m] void luaL_addstring (luaL_Buffer *B, const char *s); Adds the zero-terminated string pointed to by s to the buffer B (see luaL_Buffer).