Go to the documentation of this file.
46 #define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue)
50 #define ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
53 #define isupvalue(i) ((i) < LUA_REGISTRYINDEX)
61 if (o >= L->
top)
return &
G(L)->nilvalue;
69 return &
G(L)->l_registry;
74 return &
G(L)->nilvalue;
77 return (idx <= func->nupvalues) ? &func->
upvalue[idx-1]
114 if (res && ci->
top < L->
top + n)
123 if (from == to)
return;
126 api_check(from,
G(from) ==
G(to),
"moving among independent states");
129 for (i = 0; i < n; i++) {
141 G(L)->panic = panicf;
182 api_check(L, idx <= ci->
top - (func + 1),
"new top too large");
183 diff = ((func + 1) + idx) - L->
top;
184 for (; diff > 0; diff--)
188 api_check(L, -(idx+1) <= (L->
top - (func + 1)),
"invalid new top");
192 newtop = L->
top + diff;
193 if (diff < 0 && L->tbclist >= newtop) {
207 "no variable to close at given level");
222 for (; from < to; from++, to--) {
240 api_check(L, (n >= 0 ? n : -n) <= (t - p + 1),
"invalid 'n'");
241 m = (n >= 0 ? t - n : p - n - 1);
357 default:
api_check(L, 0,
"invalid option");
405 if (len != NULL) *len = 0;
445 default:
return NULL;
623 return (
G(L)->mainthread == L);
656 #define getGtable(L) \
657 (&hvalue(&G(L)->l_registry)->array[LUA_RIDX_GLOBALS - 1])
762 if (narray > 0 || nrec > 0)
775 switch (
ttype(obj)) {
777 mt =
hvalue(obj)->metatable;
780 mt =
uvalue(obj)->metatable;
783 mt =
G(L)->mt[
ttype(obj)];
802 if (n <= 0 || n >
uvalue(o)->nuvalue) {
939 switch (
ttype(obj)) {
941 hvalue(obj)->metatable = mt;
949 uvalue(obj)->metatable = mt;
957 G(L)->mt[
ttype(obj)] = mt;
992 #define checkresults(L,na,nr) \
993 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
994 "results from function overflow current stack size")
1002 "cannot use continuations inside hooks");
1006 func = L->
top - (nargs+1);
1009 L->
ci->
u.
c.ctx = ctx;
1043 "cannot use continuations inside hooks");
1081 const char *chunkname,
const char *mode) {
1085 if (!chunkname) chunkname =
"?";
1090 if (
f->nupvalues >= 1) {
1094 setobj(L,
f->upvals[0]->v, gt);
1132 va_start(argp, what);
1157 int data = va_arg(argp,
int);
1176 int data = va_arg(argp,
int);
1182 int data = va_arg(argp,
int);
1192 int minormul = va_arg(argp,
int);
1193 int majormul = va_arg(argp,
int);
1203 int pause = va_arg(argp,
int);
1204 int stepmul = va_arg(argp,
int);
1205 int stepsize = va_arg(argp,
int);
1233 errobj =
s2v(L->
top - 1);
1304 if (ud) *ud =
G(L)->ud;
1338 api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX,
"invalid value");
1356 *val = &
f->upvalue[n-1];
1366 *val =
f->upvals[n-1]->v;
1367 if (owner) *owner =
obj2gco(
f->upvals[n - 1]);
1369 return (name == NULL) ?
"(no name)" :
getstr(name);
1371 default:
return NULL;
1410 static const UpVal *
const nullup = NULL;
1416 if (1 <= n && n <= f->p->sizeupvalues)
1417 return &
f->upvals[n - 1];
1419 return (
UpVal**)&nullup;
1431 if (1 <= n && n <= f->nupvalues)
1432 return &
f->upvalue[n - 1];
1446 int fidx2,
int n2) {
1450 api_check(L, *up1 != NULL && *up2 != NULL,
"invalid upvalue index");
LUA_API lua_Number lua_tonumberx(lua_State *L, int idx, int *pisnum)
#define setobjs2s(L, o1, o2)
int luaV_equalobj(lua_State *L, const TValue *t1, const TValue *t2)
LUA_API void lua_rotate(lua_State *L, int idx, int n)
const LUA_API char * lua_setupvalue(lua_State *L, int funcindex, int n)
#define setthvalue(L, obj, x)
LUA_UNSIGNED lua_Unsigned
LUA_API int lua_geti(lua_State *L, int idx, lua_Integer n)
#define isdecGCmodegen(g)
LUA_API void lua_setglobal(lua_State *L, const char *name)
#define luaV_fastgeti(L, t, k, slot)
const typedef char *(* lua_Reader)(lua_State *L, void *ud, size_t *sz)
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
LUA_API int lua_checkstack(lua_State *L, int n)
void luaC_checkfinalizer(lua_State *L, GCObject *o, Table *mt)
#define luaV_finishfastset(L, t, slot, v)
#define luaC_objbarrier(L, p, o)
LUA_API int lua_getfield(lua_State *L, int idx, const char *k)
#define ttislightuserdata(o)
LUA_API int lua_pushthread(lua_State *L)
TString * luaS_new(lua_State *L, const char *str)
#define setuvalue(L, obj, x)
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
#define luaC_barrierback(L, p, v)
int(* lua_Writer)(lua_State *L, const void *p, size_t sz, void *ud)
static void aux_rawset(lua_State *L, int idx, TValue *key, int n)
LUA_API int lua_rawgetp(lua_State *L, int idx, const void *p)
LUA_API void lua_toclose(lua_State *L, int idx)
LUA_API void lua_upvaluejoin(lua_State *L, int fidx1, int n1, int fidx2, int n2)
LUA_API int lua_iscfunction(lua_State *L, int idx)
const LUA_API char * lua_pushfstring(lua_State *L, const char *fmt,...)
LUA_API int lua_gettable(lua_State *L, int idx)
LUA_API void lua_concat(lua_State *L, int n)
void luaC_step(lua_State *L)
#define setfvalue(obj, x)
LUA_API lua_Unsigned lua_rawlen(lua_State *L, int idx)
static int writer(lua_State *L, const void *b, size_t size, void *ud)
LUA_API int lua_isstring(lua_State *L, int idx)
LUA_API lua_CFunction lua_atpanic(lua_State *L, lua_CFunction panicf)
LUA_API int lua_type(lua_State *L, int idx)
#define invalidateTMcache(t)
const TValue * luaH_getint(Table *t, lua_Integer key)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
LUA_API lua_State * lua_tothread(lua_State *L, int idx)
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
LUA_API void lua_pushnumber(lua_State *L, lua_Number n)
const LUA_API char * lua_pushstring(lua_State *L, const char *s)
LUA_API int lua_dump(lua_State *L, lua_Writer writer, void *data, int strip)
LUA_API int lua_isinteger(lua_State *L, int idx)
LUA_API int lua_isnumber(lua_State *L, int idx)
#define luaV_rawequalobj(t1, t2)
LUA_API lua_Number lua_version(lua_State *L)
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
unsigned short callstatus
void *(* lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize)
const LUA_API char * lua_pushvfstring(lua_State *L, const char *fmt, va_list argp)
LUA_API void lua_arith(lua_State *L, int op)
void luaH_set(lua_State *L, Table *t, const TValue *key, TValue *value)
span_constexpr std::size_t size(span< T, Extent > const &spn)
LUA_API void lua_len(lua_State *L, int idx)
LUA_API void lua_rawset(lua_State *L, int idx)
void luaE_setdebt(global_State *g, l_mem debt)
void lua_setwarnf(lua_State *L, lua_WarnFunction f, void *ud)
static StkId index2stack(lua_State *L, int idx)
LUA_API int lua_rawget(lua_State *L, int idx)
void luaV_finishget(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
#define adjustresults(L, nres)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
LUA_API void lua_pushcclosure(lua_State *L, lua_CFunction fn, int n)
void lua_warning(lua_State *L, const char *msg, int tocont)
struct CallInfo::@12::@15 c
const TValue * luaH_get(Table *t, const TValue *key)
int luaV_lessequal(lua_State *L, const TValue *l, const TValue *r)
void luaF_close(lua_State *L, StkId level, int status, int yy)
LUA_KCONTEXT lua_KContext
void luaV_finishset(lua_State *L, const TValue *t, TValue *key, TValue *val, const TValue *slot)
#define setpvalue(obj, x)
void luaF_newtbcupval(lua_State *L, StkId level)
LUA_API int lua_rawgeti(lua_State *L, int idx, lua_Integer n)
#define setsvalue2s(L, o, s)
void luaD_call(lua_State *L, StkId func, int nResults)
#define setobj(L, obj1, obj2)
LUA_API void lua_callk(lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k)
void luaE_warning(lua_State *L, const char *msg, int tocont)
LUA_API int lua_setiuservalue(lua_State *L, int idx, int n)
static void reverse(lua_State *L, StkId from, StkId to)
LUA_API void lua_rawsetp(lua_State *L, int idx, const void *p)
static int finishrawget(lua_State *L, const TValue *val)
LUA_API int lua_isuserdata(lua_State *L, int idx)
#define LUA_REGISTRYINDEX
static int auxgetstr(lua_State *L, const TValue *t, const char *k)
LUA_API void * lua_touserdata(lua_State *L, int idx)
const LUA_API char * lua_typename(lua_State *L, int t)
const TValue * luaH_getstr(Table *t, TString *key)
void luaV_objlen(lua_State *L, StkId ra, const TValue *rb)
Table * luaH_new(lua_State *L)
LUA_API int lua_gettop(lua_State *L)
#define LUA_VLIGHTUSERDATA
CClosure * luaF_newCclosure(lua_State *L, int nupvals)
LUA_API lua_Alloc lua_getallocf(lua_State *L, void **ud)
LUA_API void lua_settop(lua_State *L, int idx)
Udata * luaS_newudata(lua_State *L, size_t s, int nuvalue)
LUA_API void lua_pushboolean(lua_State *L, int b)
static void auxsetstr(lua_State *L, const TValue *t, const char *k)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUA_API void lua_closeslot(lua_State *L, int idx)
void luaZ_init(lua_State *L, ZIO *z, lua_Reader reader, void *data)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
LUA_API int lua_status(lua_State *L)
#define LUA_TLIGHTUSERDATA
lua_Unsigned luaH_getn(Table *t)
#define checkresults(L, na, nr)
LUA_API int lua_rawequal(lua_State *L, int index1, int index2)
LUA_API int lua_pcallk(lua_State *L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k)
static const char * reader(lua_State *L, void *ud, size_t *size)
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
int luaH_next(lua_State *L, Table *t, StkId key)
const char * luaO_pushvfstring(lua_State *L, const char *fmt, va_list argp)
const LUA_API char * lua_pushlstring(lua_State *L, const char *s, size_t len)
size_t luaO_str2num(const char *s, TValue *o)
void luaV_concat(lua_State *L, int total)
int luaD_protectedparser(lua_State *L, ZIO *z, const char *name, const char *mode)
LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
#define setivalue(obj, x)
LUA_API void lua_settable(lua_State *L, int idx)
LUA_API void * lua_upvalueid(lua_State *L, int fidx, int n)
void luaO_tostring(lua_State *L, TValue *obj)
#define sethvalue2s(L, o, h)
LUA_API void lua_rawseti(lua_State *L, int idx, lua_Integer n)
static void f_call(lua_State *L, void *ud)
LUA_API int lua_getglobal(lua_State *L, const char *name)
LUA_API int lua_next(lua_State *L, int idx)
int luaD_pcall(lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef)
LUA_API void lua_seti(lua_State *L, int idx, lua_Integer n)
static Table * gettable(lua_State *L, int idx)
#define setobj2s(L, o1, o2)
int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data, int strip)
LUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx)
void luaO_arith(lua_State *L, int op, const TValue *p1, const TValue *p2, StkId res)
static void * touserdata(const TValue *o)
LUA_API void * lua_newuserdatauv(lua_State *L, size_t size, int nuvalue)
const LUA_API char * lua_getupvalue(lua_State *L, int funcindex, int n)
LUA_API lua_Integer lua_tointegerx(lua_State *L, int idx, int *pisnum)
LUA_API size_t lua_stringtonumber(lua_State *L, const char *s)
const LUA_API char * lua_tolstring(lua_State *L, int idx, size_t *len)
int(* lua_CFunction)(lua_State *L)
#define hastocloseCfunc(n)
LUA_API void lua_pushnil(lua_State *L)
int(* lua_KFunction)(lua_State *L, int status, lua_KContext ctx)
LUA_API int lua_getiuservalue(lua_State *L, int idx, int n)
static TValue * index2value(lua_State *L, int idx)
#define setfltvalue(obj, x)
LUA_API int lua_toboolean(lua_State *L, int idx)
#define setclCvalue(L, obj, x)
#define luaV_fastget(L, t, k, slot, f)
#define api_check(l, e, msg)
LUA_API void lua_setallocf(lua_State *L, lua_Alloc f, void *ud)
void luaC_fullgc(lua_State *L, int isemergency)
void(* lua_WarnFunction)(void *ud, const char *msg, int tocont)
int luaV_lessthan(lua_State *L, const TValue *l, const TValue *r)
LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode)
int luaD_growstack(lua_State *L, int n, int raiseerror)
LUA_API int lua_compare(lua_State *L, int index1, int index2, int op)
LUA_API int lua_absindex(lua_State *L, int idx)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
void luaC_changemode(lua_State *L, int newmode)
LUA_API int lua_gc(lua_State *L, int what,...)
#define api_checknelems(L, n)
LUA_API void lua_pushlightuserdata(lua_State *L, void *p)
static UpVal ** getupvalref(lua_State *L, int fidx, int n, LClosure **pf)
l_noret luaG_errormsg(lua_State *L)
#define luaC_barrier(L, p, v)
LUA_API void lua_copy(lua_State *L, int fromidx, int toidx)
#define ttisfulluserdata(o)
static const char * aux_upvalue(TValue *fi, int n, TValue **val, GCObject **owner)
LUA_API int lua_error(lua_State *L)
const LUA_API void * lua_topointer(lua_State *L, int idx)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44