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

luaL_addsize

luaL_addsize[-?, +?, –] void luaL_addsize (luaL_Buffer *B, size_t n); Adds to the buffer B (see luaL_Buffer) a string of length n previously copied to the buffer area (see luaL_prepbuffer).

luaL_addlstring

luaL_addlstring[-?, +?, m] void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); Adds the string pointed to by s with length l to the buffer B (see luaL_Buffer). The string can contain embedded zeros.

luaL_addchar

luaL_addchar[-?, +?, m] void luaL_addchar (luaL_Buffer *B, char c); Adds the byte c to the buffer B (see luaL_Buffer).