luaL_requiref

luaL_requiref[-0, +1, e] void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb); If modname is not already present in package.loaded, calls function openf with string modname as an argument and sets the call result in package.loaded[modname], as if that function has been called through require. If glb is true, also stores the module into global modname. Leaves a copy of the module on the stack.

luaL_Reg

luaL_Reg typedef struct luaL_Reg { const char *name; lua_CFunction func; } luaL_Reg; Type for arrays of functions to be registered by luaL_setfuncs. name is the function name and func is a pointer to the function. Any array of luaL_Reg must end with a sentinel entry in which both name and func are NULL.

luaL_ref

luaL_ref[-1, +0, m] int luaL_ref (lua_State *L, int t); Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object). A reference is a unique integer key. As long as you do not manually add integer keys into table t, luaL_ref ensures the uniqueness of the key it returns. You can retrieve an object referred by reference r by calling lua_rawgeti(L, t, r). Function luaL_unref frees a reference and its associated object. If the object

luaL_pushresultsize

luaL_pushresultsize[-?, +1, m] void luaL_pushresultsize (luaL_Buffer *B, size_t sz); Equivalent to the sequence luaL_addsize, luaL_pushresult.

luaL_pushresult

luaL_pushresult[-?, +1, m] void luaL_pushresult (luaL_Buffer *B); Finishes the use of buffer B leaving the final string on the top of the stack.

luaL_prepbuffsize

luaL_prepbuffsize[-?, +?, m] char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz); Returns an address to a space of size sz where you can copy a string to be added to buffer B (see luaL_Buffer). After copying the string into this space you must call luaL_addsize with the size of the string to actually add it to the buffer.

luaL_prepbuffer

luaL_prepbuffer[-?, +?, m] char *luaL_prepbuffer (luaL_Buffer *B); Equivalent to luaL_prepbuffsize with the predefined size LUAL_BUFFERSIZE.

luaL_optstring

luaL_optstring[-0, +0, v] const char *luaL_optstring (lua_State *L, int arg, const char *d); If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d. Otherwise, raises an error.

luaL_optnumber

luaL_optnumber[-0, +0, v] lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number d); If the function argument arg is a number, returns this number. If this argument is absent or is nil, returns d. Otherwise, raises an error.

luaL_optlstring

luaL_optlstring[-0, +0, v] const char *luaL_optlstring (lua_State *L, int arg, const char *d, size_t *l); If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns d. Otherwise, raises an error. If l is not NULL, fills the position *l with the result's length. If the result is NULL (only possible when returning d and d == NULL), its length is considered