Classes | Macros | Typedefs | Functions | Variables
lauxlib.c File Reference
#include "lprefix.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
Include dependency graph for lauxlib.c:

Go to the source code of this file.

Classes

struct  LoadF
 
struct  LoadS
 
struct  UBox
 

Macros

#define buffonstack(B)   ((B)->b != (B)->init.b)
 
#define checkbufferlevel(B, idx)
 
#define freelist   (LUA_RIDX_LAST + 1)
 
#define l_inspectstat(stat, what)   /* no op */
 
#define lauxlib_c
 
#define LEVELS1   10 /* size of the first part of the stack */
 
#define LEVELS2   11 /* size of the second part of the stack */
 
#define LUA_LIB
 
#define MAX_SIZET   ((size_t)(~(size_t)0))
 

Typedefs

typedef struct LoadF LoadF
 
typedef struct LoadS LoadS
 
typedef struct UBox UBox
 

Functions

static int boxgc (lua_State *L)
 
static int checkcontrol (lua_State *L, const char *message, int tocont)
 
static int errfile (lua_State *L, const char *what, int fnameindex)
 
static int findfield (lua_State *L, int objidx, int level)
 
static const char * getF (lua_State *L, void *ud, size_t *size)
 
static const char * getS (lua_State *L, void *ud, size_t *size)
 
static void interror (lua_State *L, int arg)
 
static void * l_alloc (void *ud, void *ptr, size_t osize, size_t nsize)
 
static int lastlevel (lua_State *L)
 
LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s, const char *p, const char *r)
 
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 arg, const char *extramsg)
 
LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B)
 
LUALIB_API char * luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz)
 
LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event)
 
LUALIB_API void luaL_checkany (lua_State *L, int arg)
 
LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int arg)
 
const LUALIB_API char * luaL_checklstring (lua_State *L, int arg, size_t *len)
 
LUALIB_API lua_Number luaL_checknumber (lua_State *L, int arg)
 
LUALIB_API int luaL_checkoption (lua_State *L, int arg, const char *def, const char *const lst[])
 
LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg)
 
LUALIB_API void luaL_checktype (lua_State *L, int arg, int t)
 
LUALIB_API void * luaL_checkudata (lua_State *L, int ud, const char *tname)
 
LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz)
 
LUALIB_API int luaL_error (lua_State *L, const char *fmt,...)
 
LUALIB_API int luaL_execresult (lua_State *L, int stat)
 
LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname)
 
LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event)
 
LUALIB_API int luaL_getsubtable (lua_State *L, int idx, const char *fname)
 
const LUALIB_API char * luaL_gsub (lua_State *L, const char *s, const char *p, const char *r)
 
LUALIB_API lua_Integer luaL_len (lua_State *L, int idx)
 
LUALIB_API int luaL_loadbufferx (lua_State *L, const char *buff, size_t size, const char *name, const char *mode)
 
LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, const char *mode)
 
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_StateluaL_newstate (void)
 
LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int arg, lua_Integer def)
 
const LUALIB_API char * luaL_optlstring (lua_State *L, int arg, const char *def, size_t *len)
 
LUALIB_API lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number def)
 
LUALIB_API char * luaL_prepbuffsize (luaL_Buffer *B, size_t sz)
 
LUALIB_API void luaL_pushresult (luaL_Buffer *B)
 
LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz)
 
LUALIB_API int luaL_ref (lua_State *L, int t)
 
LUALIB_API void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb)
 
LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup)
 
LUALIB_API void luaL_setmetatable (lua_State *L, const char *tname)
 
LUALIB_API void * luaL_testudata (lua_State *L, int ud, const char *tname)
 
const LUALIB_API char * luaL_tolstring (lua_State *L, int idx, size_t *len)
 
LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, int level)
 
LUALIB_API int luaL_typeerror (lua_State *L, int arg, 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 void newbox (lua_State *L)
 
static size_t newbuffsize (luaL_Buffer *B, size_t sz)
 
static int panic (lua_State *L)
 
static char * prepbuffsize (luaL_Buffer *B, size_t sz, int boxidx)
 
static void pushfuncname (lua_State *L, lua_Debug *ar)
 
static int pushglobalfuncname (lua_State *L, lua_Debug *ar)
 
static void * resizebox (lua_State *L, int idx, size_t newsize)
 
static int skipBOM (LoadF *lf)
 
static int skipcomment (LoadF *lf, int *cp)
 
static void tag_error (lua_State *L, int arg, int tag)
 
static void warnfcont (void *ud, const char *message, int tocont)
 
static void warnfoff (void *ud, const char *message, int tocont)
 
static void warnfon (void *ud, const char *message, int tocont)
 

Variables

static const luaL_Reg boxmt []
 

Macro Definition Documentation

◆ buffonstack

#define buffonstack (   B)    ((B)->b != (B)->init.b)

Definition at line 515 of file lauxlib.c.

◆ checkbufferlevel

#define checkbufferlevel (   B,
  idx 
)
Value:
lua_assert(buffonstack(B) ? lua_touserdata(B->L, idx) != NULL \
: lua_touserdata(B->L, idx) == (void*)B)

Definition at line 522 of file lauxlib.c.

◆ freelist

#define freelist   (LUA_RIDX_LAST + 1)

Definition at line 653 of file lauxlib.c.

◆ l_inspectstat

#define l_inspectstat (   stat,
  what 
)    /* no op */

Definition at line 278 of file lauxlib.c.

◆ lauxlib_c

#define lauxlib_c

Definition at line 7 of file lauxlib.c.

◆ LEVELS1

#define LEVELS1   10 /* size of the first part of the stack */

Definition at line 43 of file lauxlib.c.

◆ LEVELS2

#define LEVELS2   11 /* size of the second part of the stack */

Definition at line 44 of file lauxlib.c.

◆ LUA_LIB

#define LUA_LIB

Definition at line 8 of file lauxlib.c.

◆ MAX_SIZET

#define MAX_SIZET   ((size_t)(~(size_t)0))

Definition at line 32 of file lauxlib.c.

Typedef Documentation

◆ LoadF

typedef struct LoadF LoadF

◆ LoadS

typedef struct LoadS LoadS

◆ UBox

typedef struct UBox UBox

Function Documentation

◆ boxgc()

static int boxgc ( lua_State L)
static

Definition at line 488 of file lauxlib.c.

◆ checkcontrol()

static int checkcontrol ( lua_State L,
const char *  message,
int  tocont 
)
static

Definition at line 1045 of file lauxlib.c.

◆ errfile()

static int errfile ( lua_State L,
const char *  what,
int  fnameindex 
)
static

Definition at line 733 of file lauxlib.c.

◆ findfield()

static int findfield ( lua_State L,
int  objidx,
int  level 
)
static

Definition at line 52 of file lauxlib.c.

◆ getF()

static const char* getF ( lua_State L,
void *  ud,
size_t *  size 
)
static

Definition at line 715 of file lauxlib.c.

◆ getS()

static const char* getS ( lua_State L,
void *  ud,
size_t *  size 
)
static

Definition at line 818 of file lauxlib.c.

◆ interror()

static void interror ( lua_State L,
int  arg 
)
static

Definition at line 434 of file lauxlib.c.

◆ l_alloc()

static void* l_alloc ( void *  ud,
void *  ptr,
size_t  osize,
size_t  nsize 
)
static

Definition at line 1010 of file lauxlib.c.

◆ lastlevel()

static int lastlevel ( lua_State L)
static

Definition at line 116 of file lauxlib.c.

◆ luaL_addgsub()

LUALIB_API void luaL_addgsub ( luaL_Buffer b,
const char *  s,
const char *  p,
const char *  r 
)

Definition at line 987 of file lauxlib.c.

◆ luaL_addlstring()

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

Definition at line 579 of file lauxlib.c.

◆ luaL_addstring()

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

Definition at line 588 of file lauxlib.c.

◆ luaL_addvalue()

LUALIB_API void luaL_addvalue ( luaL_Buffer B)

Definition at line 618 of file lauxlib.c.

◆ luaL_argerror()

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

Definition at line 175 of file lauxlib.c.

◆ luaL_buffinit()

LUALIB_API void luaL_buffinit ( lua_State L,
luaL_Buffer B 
)

Definition at line 629 of file lauxlib.c.

◆ luaL_buffinitsize()

LUALIB_API char* luaL_buffinitsize ( lua_State L,
luaL_Buffer B,
size_t  sz 
)

Definition at line 638 of file lauxlib.c.

◆ luaL_callmeta()

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

Definition at line 861 of file lauxlib.c.

◆ luaL_checkany()

LUALIB_API void luaL_checkany ( lua_State L,
int  arg 
)

Definition at line 396 of file lauxlib.c.

◆ luaL_checkinteger()

LUALIB_API lua_Integer luaL_checkinteger ( lua_State L,
int  arg 
)

Definition at line 442 of file lauxlib.c.

◆ luaL_checklstring()

const LUALIB_API char* luaL_checklstring ( lua_State L,
int  arg,
size_t *  len 
)

Definition at line 402 of file lauxlib.c.

◆ luaL_checknumber()

LUALIB_API lua_Number luaL_checknumber ( lua_State L,
int  arg 
)

Definition at line 420 of file lauxlib.c.

◆ luaL_checkoption()

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

Definition at line 360 of file lauxlib.c.

◆ luaL_checkstack()

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

Definition at line 380 of file lauxlib.c.

◆ luaL_checktype()

LUALIB_API void luaL_checktype ( lua_State L,
int  arg,
int  t 
)

Definition at line 390 of file lauxlib.c.

◆ luaL_checkudata()

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

Definition at line 345 of file lauxlib.c.

◆ luaL_checkversion_()

LUALIB_API void luaL_checkversion_ ( lua_State L,
lua_Number  ver,
size_t  sz 
)

Definition at line 1097 of file lauxlib.c.

◆ luaL_error()

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

Definition at line 234 of file lauxlib.c.

◆ luaL_execresult()

LUALIB_API int luaL_execresult ( lua_State L,
int  stat 
)

Definition at line 285 of file lauxlib.c.

◆ luaL_fileresult()

LUALIB_API int luaL_fileresult ( lua_State L,
int  stat,
const char *  fname 
)

Definition at line 245 of file lauxlib.c.

◆ luaL_getmetafield()

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

Definition at line 845 of file lauxlib.c.

◆ luaL_getsubtable()

LUALIB_API int luaL_getsubtable ( lua_State L,
int  idx,
const char *  fname 
)

Definition at line 947 of file lauxlib.c.

◆ luaL_gsub()

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

Definition at line 1000 of file lauxlib.c.

◆ luaL_len()

LUALIB_API lua_Integer luaL_len ( lua_State L,
int  idx 
)

Definition at line 871 of file lauxlib.c.

◆ luaL_loadbufferx()

LUALIB_API int luaL_loadbufferx ( lua_State L,
const char *  buff,
size_t  size,
const char *  name,
const char *  mode 
)

Definition at line 828 of file lauxlib.c.

◆ luaL_loadfilex()

LUALIB_API int luaL_loadfilex ( lua_State L,
const char *  filename,
const char *  mode 
)

Definition at line 776 of file lauxlib.c.

◆ luaL_loadstring()

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

Definition at line 837 of file lauxlib.c.

◆ luaL_newmetatable()

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

Definition at line 311 of file lauxlib.c.

◆ luaL_newstate()

LUALIB_API lua_State* luaL_newstate ( void  )

Definition at line 1087 of file lauxlib.c.

◆ luaL_optinteger()

LUALIB_API lua_Integer luaL_optinteger ( lua_State L,
int  arg,
lua_Integer  def 
)

Definition at line 452 of file lauxlib.c.

◆ luaL_optlstring()

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

Definition at line 409 of file lauxlib.c.

◆ luaL_optnumber()

LUALIB_API lua_Number luaL_optnumber ( lua_State L,
int  arg,
lua_Number  def 
)

Definition at line 429 of file lauxlib.c.

◆ luaL_prepbuffsize()

LUALIB_API char* luaL_prepbuffsize ( luaL_Buffer B,
size_t  sz 
)

Definition at line 574 of file lauxlib.c.

◆ luaL_pushresult()

LUALIB_API void luaL_pushresult ( luaL_Buffer B)

Definition at line 593 of file lauxlib.c.

◆ luaL_pushresultsize()

LUALIB_API void luaL_pushresultsize ( luaL_Buffer B,
size_t  sz 
)

Definition at line 603 of file lauxlib.c.

◆ luaL_ref()

LUALIB_API int luaL_ref ( lua_State L,
int  t 
)

Definition at line 660 of file lauxlib.c.

◆ luaL_requiref()

LUALIB_API void luaL_requiref ( lua_State L,
const char *  modname,
lua_CFunction  openf,
int  glb 
)

Definition at line 967 of file lauxlib.c.

◆ luaL_setfuncs()

LUALIB_API void luaL_setfuncs ( lua_State L,
const luaL_Reg l,
int  nup 
)

Definition at line 926 of file lauxlib.c.

◆ luaL_setmetatable()

LUALIB_API void luaL_setmetatable ( lua_State L,
const char *  tname 
)

Definition at line 324 of file lauxlib.c.

◆ luaL_testudata()

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

Definition at line 330 of file lauxlib.c.

◆ luaL_tolstring()

const LUALIB_API char* luaL_tolstring ( lua_State L,
int  idx,
size_t *  len 
)

Definition at line 883 of file lauxlib.c.

◆ luaL_traceback()

LUALIB_API void luaL_traceback ( lua_State L,
lua_State L1,
const char *  msg,
int  level 
)

Definition at line 131 of file lauxlib.c.

◆ luaL_typeerror()

LUALIB_API int luaL_typeerror ( lua_State L,
int  arg,
const char *  tname 
)

Definition at line 193 of file lauxlib.c.

◆ luaL_unref()

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

Definition at line 688 of file lauxlib.c.

◆ luaL_where()

LUALIB_API void luaL_where ( lua_State L,
int  level 
)

Definition at line 216 of file lauxlib.c.

◆ newbox()

static void newbox ( lua_State L)
static

Definition at line 501 of file lauxlib.c.

◆ newbuffsize()

static size_t newbuffsize ( luaL_Buffer B,
size_t  sz 
)
static

Definition at line 531 of file lauxlib.c.

◆ panic()

static int panic ( lua_State L)
static

Definition at line 1021 of file lauxlib.c.

◆ prepbuffsize()

static char* prepbuffsize ( luaL_Buffer B,
size_t  sz,
int  boxidx 
)
static

Definition at line 546 of file lauxlib.c.

◆ pushfuncname()

static void pushfuncname ( lua_State L,
lua_Debug ar 
)
static

Definition at line 100 of file lauxlib.c.

◆ pushglobalfuncname()

static int pushglobalfuncname ( lua_State L,
lua_Debug ar 
)
static

Definition at line 79 of file lauxlib.c.

◆ resizebox()

static void* resizebox ( lua_State L,
int  idx,
size_t  newsize 
)
static

Definition at line 473 of file lauxlib.c.

◆ skipBOM()

static int skipBOM ( LoadF lf)
static

Definition at line 742 of file lauxlib.c.

◆ skipcomment()

static int skipcomment ( LoadF lf,
int *  cp 
)
static

Definition at line 763 of file lauxlib.c.

◆ tag_error()

static void tag_error ( lua_State L,
int  arg,
int  tag 
)
static

Definition at line 207 of file lauxlib.c.

◆ warnfcont()

static void warnfcont ( void *  ud,
const char *  message,
int  tocont 
)
static

Definition at line 1067 of file lauxlib.c.

◆ warnfoff()

static void warnfoff ( void *  ud,
const char *  message,
int  tocont 
)
static

Definition at line 1058 of file lauxlib.c.

◆ warnfon()

static void warnfon ( void *  ud,
const char *  message,
int  tocont 
)
static

Definition at line 1079 of file lauxlib.c.

Variable Documentation

◆ boxmt

const luaL_Reg boxmt[]
static
Initial value:
= {
{"__gc", boxgc},
{"__close", boxgc},
{NULL, NULL}
}

Definition at line 494 of file lauxlib.c.

lua_assert
#define lua_assert(c)
Definition: lauxlib.h:170
buffonstack
#define buffonstack(B)
Definition: lauxlib.c:515
lua_touserdata
LUA_API void * lua_touserdata(lua_State *L, int idx)
Definition: lapi.c:450
boxgc
static int boxgc(lua_State *L)
Definition: lauxlib.c:488
B
#define B(name, bit)


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49