# lauxlib.c File Reference

`#include <ctype.h>`
`#include <errno.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "lua.h"`
`#include "lauxlib.h"`

## Classes
struct | LoadF
struct | LoadS
## Defines
#define | lauxlib_c
#define | LUA_LIB
#define | FREELIST_REF 0
#define | abs_index(L, i)
#define | bufflen(B) ((B)->p - (B)->buffer)
#define | bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B)))
#define | LIMIT (LUA_MINSTACK/2)
## Functions
LUALIB_API int | luaL_argerror (lua_State *L, int narg, const char *extramsg)
LUALIB_API int | luaL_typerror (lua_State *L, int narg, const char *tname)
static void | tag_error (lua_State *L, int narg, int tag)
LUALIB_API void | luaL_where (lua_State *L, int level)
LUALIB_API int | luaL_error (lua_State *L, const char *fmt,...)
LUALIB_API int | luaL_checkoption (lua_State *L, int narg, const char *def, const char *const lst[])
LUALIB_API int | luaL_newmetatable (lua_State *L, const char *tname)
LUALIB_API void * | luaL_checkudata (lua_State *L, int ud, const char *tname)
LUALIB_API void | luaL_checkstack (lua_State *L, int space, const char *mes)
LUALIB_API void | luaL_checktype (lua_State *L, int narg, int t)
LUALIB_API void | luaL_checkany (lua_State *L, int narg)
LUALIB_API char * | luaL_checklstring (lua_State *L, int narg, size_t *len)
LUALIB_API const char * | luaL_optlstring (lua_State *L, int narg, const char *def, size_t *len)
LUALIB_API lua_Number | luaL_checknumber (lua_State *L, int narg)
LUALIB_API lua_Number | luaL_optnumber (lua_State *L, int narg, lua_Number def)
LUALIB_API lua_Integer | luaL_checkinteger (lua_State *L, int narg)
LUALIB_API lua_Integer | luaL_optinteger (lua_State *L, int narg, lua_Integer def)
LUALIB_API int | luaL_getmetafield (lua_State *L, int obj, const char *event)
LUALIB_API int | luaL_callmeta (lua_State *L, int obj, const char *event)
LUALIB_API void() | luaL_register (lua_State *L, const char *libname, const luaL_Reg *l)
static int | libsize (const luaL_Reg *l)
LUALIB_API void | luaI_openlib (lua_State *L, const char *libname, const luaL_Reg *l, int nup)
LUALIB_API const char * | luaL_gsub (lua_State *L, const char *s, const char *p, const char *r)
LUALIB_API const char * | luaL_findtable (lua_State *L, int idx, const char *fname, int szhint)
static int | emptybuffer (luaL_Buffer *B)
static void | adjuststack (luaL_Buffer *B)
LUALIB_API char * | luaL_prepbuffer (luaL_Buffer *B)
LUALIB_API void | luaL_addlstring (luaL_Buffer *B, const char *s, size_t l)
LUALIB_API void | luaL_addstring (luaL_Buffer *B, const char *s)
LUALIB_API void | luaL_pushresult (luaL_Buffer *B)
LUALIB_API void | luaL_addvalue (luaL_Buffer *B)
LUALIB_API void | luaL_buffinit (lua_State *L, luaL_Buffer *B)
LUALIB_API int | luaL_ref (lua_State *L, int t)
LUALIB_API void | luaL_unref (lua_State *L, int t, int ref)
static const char * | getF (lua_State *L, void *ud, size_t *size)
static int | errfile (lua_State *L, const char *what, int fnameindex)
LUALIB_API int | luaL_loadfile (lua_State *L, const char *filename)
static const char * | getS (lua_State *L, void *ud, size_t *size)
LUALIB_API int | luaL_loadbuffer (lua_State *L, const char *buff, size_t size, const char *name)
LUALIB_API int() | luaL_loadstring (lua_State *L, const char *s)
static void * | l_alloc (void *ud, void *ptr, size_t osize, size_t nsize)
static int | panic (lua_State *L)
LUALIB_API lua_State * | luaL_newstate (void)

## Define Documentation

#define abs_index | ( | L,
|  | i |  | ) |

Value:

    ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \
                                            lua_gettop(L) + (i) + 1)

#define bufffree | ( | B |  | ) | ((size_t)(LUAL_BUFFERSIZE - bufflen(B)))

#define bufflen | ( | B |  | ) | ((B)->p - (B)->buffer)

#define FREELIST_REF 0

#define lauxlib_c

#define LIMIT (LUA_MINSTACK/2)

#define LUA_LIB

## Function Documentation

static void adjuststack | ( | luaL_Buffer * | B | ) | `[static]`

static int emptybuffer | ( | luaL_Buffer * | B | ) | `[static]`

static int errfile | ( | lua_State * | L,
|  | const char * | what,
|  | int | fnameindex |
| ) |  |  | `[static]`

static const char* getF | ( | lua_State * | L,
|  | void * | ud,
|  | size_t * | size |
| ) |  |  | `[static]`

static const char* getS | ( | lua_State * | L,
|  | void * | ud,
|  | size_t * | size |
| ) |  |  | `[static]`

static void* l_alloc | ( | void * | ud,
|  | void * | ptr,
|  | size_t | osize,
|  | size_t | nsize |
| ) |  |  | `[static]`

static int libsize | ( | const luaL_Reg * | l | ) | `[static]`

LUALIB_API void luaI_openlib | ( | lua_State * | L,
|  | const char * | libname,
|  | const luaL_Reg * | l,
|  | int | nup |
| ) |  |  |

LUALIB_API void luaL_addlstring | ( | luaL_Buffer * | B,
|  | const char * | s,
|  | size_t | l |
| ) |  |  |

LUALIB_API void luaL_addstring | ( | luaL_Buffer * | B,
|  | const char * | s |
| ) |  |  |

LUALIB_API void luaL_addvalue | ( | luaL_Buffer * | B | ) |

LUALIB_API int luaL_argerror | ( | lua_State * | L,
|  | int | narg,
|  | const char * | extramsg |
| ) |  |  |

LUALIB_API void luaL_buffinit | ( | lua_State * | L,
|  | luaL_Buffer * | B |
| ) |  |  |

LUALIB_API int luaL_callmeta | ( | lua_State * | L,
|  | int | obj,
|  | const char * | event |
| ) |  |  |

LUALIB_API void luaL_checkany | ( | lua_State * | L,
|  | int | narg |
| ) |  |  |

LUALIB_API lua_Integer luaL_checkinteger | ( | lua_State * | L,
|  | int | narg |
| ) |  |  |

LUALIB_API char* luaL_checklstring | ( | lua_State * | L,
|  | int | narg,
|  | size_t * | len |
| ) |  |  |

LUALIB_API lua_Number luaL_checknumber | ( | lua_State * | L,
|  | int | narg |
| ) |  |  |

LUALIB_API int luaL_checkoption | ( | lua_State * | L,
|  | int | narg,
|  | const char * | def,
|  | const char *const | lst[] |
| ) |  |  |

LUALIB_API void luaL_checkstack | ( | lua_State * | L,
|  | int | space,
|  | const char * | mes |
| ) |  |  |

LUALIB_API void luaL_checktype | ( | lua_State * | L,
|  | int | narg,
|  | int | t |
| ) |  |  |

LUALIB_API void* luaL_checkudata | ( | lua_State * | L,
|  | int | ud,
|  | const char * | tname |
| ) |  |  |

LUALIB_API int luaL_error | ( | lua_State * | L,
|  | const char * | fmt,
|  |  | ... |
| ) |  |  |

LUALIB_API const char* luaL_findtable | ( | lua_State * | L,
|  | int | idx,
|  | const char * | fname,
|  | int | szhint |
| ) |  |  |

LUALIB_API int luaL_getmetafield | ( | lua_State * | L,
|  | int | obj,
|  | const char * | event |
| ) |  |  |

LUALIB_API const char* luaL_gsub | ( | lua_State * | L,
|  | const char * | s,
|  | const char * | p,
|  | const char * | r |
| ) |  |  |

LUALIB_API int luaL_loadbuffer | ( | lua_State * | L,
|  | const char * | buff,
|  | size_t | size,
|  | const char * | name |
| ) |  |  |

LUALIB_API int luaL_loadfile | ( | lua_State * | L,
|  | const char * | filename |
| ) |  |  |

LUALIB_API int() luaL_loadstring | ( | lua_State * | L,
|  | const char * | s |
| ) |  |  |

LUALIB_API int luaL_newmetatable | ( | lua_State * | L,
|  | const char * | tname |
| ) |  |  |

LUALIB_API lua_State* luaL_newstate | ( | void |  | ) |

LUALIB_API lua_Integer luaL_optinteger | ( | lua_State * | L,
|  | int | narg,
|  | lua_Integer | def |
| ) |  |  |

LUALIB_API const char* luaL_optlstring | ( | lua_State * | L,
|  | int | narg,
|  | const char * | def,
|  | size_t * | len |
| ) |  |  |

LUALIB_API lua_Number luaL_optnumber | ( | lua_State * | L,
|  | int | narg,
|  | lua_Number | def |
| ) |  |  |

LUALIB_API char* luaL_prepbuffer | ( | luaL_Buffer * | B | ) |

LUALIB_API void luaL_pushresult | ( | luaL_Buffer * | B | ) |

LUALIB_API int luaL_ref | ( | lua_State * | L,
|  | int | t |
| ) |  |  |

LUALIB_API void() luaL_register | ( | lua_State * | L,
|  | const char * | libname,
|  | const luaL_Reg * | l |
| ) |  |  |

LUALIB_API int luaL_typerror | ( | lua_State * | L,
|  | int | narg,
|  | const char * | tname |
| ) |  |  |

LUALIB_API void luaL_unref | ( | lua_State * | L,
|  | int | t,
|  | int | ref |
| ) |  |  |

LUALIB_API void luaL_where | ( | lua_State * | L,
|  | int | level |
| ) |  |  |

static int panic | ( | lua_State * | L | ) | `[static]`

static void tag_error | ( | lua_State * | L,
|  | int | narg,
|  | int | tag |
| ) |  |  | `[static]`