40#define NONVALIDVALUE cast(TValue *, luaO_nilobject)
43#define isvalid(o) ((o) != luaO_nilobject)
46#define ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
49#define isupvalue(i) ((i) < LUA_REGISTRYINDEX)
52#define isstackindex(i, o) (isvalid(o) && !ispseudo(i))
54#define api_checkvalidindex(l,o) api_check(l, isvalid(o), "invalid index")
56#define api_checkstackindex(l, i, o) \
57 api_check(l, isstackindex(i, o), "index not in the stack")
64 api_check(L, idx <= ci->top - (ci->
func + 1),
"unacceptable index");
69 api_check(L, idx != 0 && -idx <= L->top - (ci->
func + 1),
"invalid index");
73 return &
G(L)->l_registry;
92 int size = *(
int *)ud;
111 if (res && ci->
top < L->
top + n)
120 if (from == to)
return;
123 api_check(from,
G(from) ==
G(to),
"moving among independent states");
126 for (i = 0; i < n; i++) {
138 G(L)->panic = panicf;
146 if (L ==
NULL)
return &version;
147 else return G(L)->version;
176 api_check(L, idx <= L->stack_last - (func + 1),
"new top too large");
177 while (L->
top < (func + 1) + idx)
179 L->
top = (func + 1) + idx;
182 api_check(L, -(idx+1) <= (L->
top - (func + 1)),
"invalid new top");
194 for (; from < to; from++, to--) {
213 api_check(L, (n >= 0 ? n : -n) <= (t - p + 1),
"invalid 'n'");
214 m = (n >= 0 ? t - n : p - n - 1);
329 default:
api_check(L, 0,
"invalid option");
351 if (pisnum) *pisnum = isnum;
362 if (pisnum) *pisnum = isnum;
377 if (len !=
NULL) *len = 0;
418 default:
return NULL;
439 default:
return NULL;
578 return (
G(L)->mainthread == L);
690 if (narray > 0 || nrec > 0)
703 switch (
ttnov(obj)) {
711 mt =
G(L)->mt[
ttnov(obj)];
858 switch (
ttnov(obj)) {
860 hvalue(obj)->metatable = mt;
868 uvalue(obj)->metatable = mt;
876 G(L)->mt[
ttnov(obj)] = mt;
904#define checkresults(L,na,nr) \
905 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
906 "results from function overflow current stack size")
914 "cannot use continuations inside hooks");
918 func = L->
top - (nargs+1);
919 if (k !=
NULL && L->
nny == 0) {
955 "cannot use continuations inside hooks");
993 const char *chunkname,
const char *mode) {
997 if (!chunkname) chunkname =
"?";
1002 if (f->nupvalues >= 1) {
1093 if (data < 40) data = 40;
1169 if (ud) *ud =
G(L)->ud;
1199 switch (
ttype(fi)) {
1202 if (!(1 <= n && n <= f->nupvalues))
return NULL;
1211 if (!(1 <= n && n <= p->sizeupvalues))
return NULL;
1213 if (uv) *uv = f->
upvals[n - 1];
1217 default:
return NULL;
1262 api_check(L, (1 <= n && n <= f->p->sizeupvalues),
"invalid upvalue index");
1263 return &f->
upvals[n - 1];
1269 switch (
ttype(fi)) {
1275 api_check(L, 1 <= n && n <= f->nupvalues,
"invalid upvalue index");
1287 int fidx2,
int n2) {
1295 if (
upisopen(*up1)) (*up1)->u.open.touched = 1;
#define lua_rawlen(L, index)
#define api_checknelems(L, n)
#define adjustresults(L, nres)
void luaG_errormsg(lua_State *L)
int luaD_pcall(lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef)
int luaD_protectedparser(lua_State *L, ZIO *z, const char *name)
void luaD_call(lua_State *L, StkId func, int nResults)
void luaD_growstack(lua_State *L, int n)
int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud)
int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data, int strip)
Closure * luaF_newCclosure(lua_State *L, int nelems, Table *e)
void luaC_fullgc(lua_State *L)
void luaC_step(lua_State *L)
#define luaC_barrier(L, p, v)
#define luaC_objbarrier(L, p, o)
const char * luaO_pushvfstring(lua_State *L, const char *fmt, va_list argp)
#define setpvalue(obj, x)
#define setbvalue(obj, x)
#define ttislightuserdata(o)
#define setthvalue(L, obj, x)
#define setuvalue(L, obj, x)
#define sethvalue(L, obj, x)
#define setobj(L, obj1, obj2)
Udata * luaS_newudata(lua_State *L, size_t s, Table *e)
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
static int writer(lua_State *L, const void *b, size_t size, void *B)
const TValue * luaH_get(Table *t, const TValue *key)
Table * luaH_new(lua_State *L, int narray, int nhash)
const TValue * luaH_getstr(Table *t, TString *key)
int luaH_next(lua_State *L, Table *t, StkId key)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
const char *(* lua_Reader)(lua_State *L, void *ud, size_t *sz)
void *(* lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize)
#define LUA_REGISTRYINDEX
int(* lua_Writer)(lua_State *L, const void *p, size_t sz, void *ud)
int(* lua_CFunction)(lua_State *L)
#define LUA_TLIGHTUSERDATA
#define lua_setglobal(L, s)
#define lua_getglobal(L, s)
void luaV_concat(lua_State *L, int total, int last)
int luaV_lessthan(lua_State *L, const TValue *l, const TValue *r)
void luaZ_init(lua_State *L, ZIO *z, lua_Reader reader, void *data)
void luaC_checkfinalizer(lua_State *L, GCObject *o, Table *mt)
#define luaC_barrierback(L, p, v)
lua_Number luaO_arith(int op, lua_Number v1, lua_Number v2)
#define setfvalue(obj, x)
#define setclCvalue(L, obj, x)
void luaE_setdebt(global_State *g, l_mem debt)
void luaH_resize(lua_State *L, Table *t, int nasize, int nhsize)
void luaH_setint(lua_State *L, Table *t, int key, TValue *value)
const TValue * luaH_getint(Table *t, int key)
#define invalidateTMcache(t)
static const char * reader(lua_State *L, void *ud, size_t *size)
int luaV_lessequal(lua_State *L, const TValue *l, const TValue *r)
void luaV_objlen(lua_State *L, StkId ra, const TValue *rb)
#define luaV_rawequalobj(o1, o2)
LUA_API const char * lua_pushlstring(lua_State *L, const char *s, size_t len)
static void auxsetstr(lua_State *L, const TValue *t, const char *k)
LUA_API void lua_arith(lua_State *L, int op)
LUA_API void lua_copy(lua_State *L, int fromidx, int toidx)
LUA_API void lua_pushcclosure(lua_State *L, lua_CFunction fn, int n)
#define api_checkstackindex(l, i, o)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
static int auxgetstr(lua_State *L, const TValue *t, const char *k)
LUA_API void lua_pushnil(lua_State *L)
LUA_API int lua_checkstack(lua_State *L, int n)
LUA_API void lua_concat(lua_State *L, int n)
LUA_API void lua_len(lua_State *L, int idx)
static void reverse(lua_State *L, StkId from, StkId to)
LUA_API int lua_absindex(lua_State *L, int idx)
LUA_API void lua_pushnumber(lua_State *L, lua_Number n)
#define api_checkvalidindex(l, o)
LUA_API const char * lua_pushfstring(lua_State *L, const char *fmt,...)
LUA_API lua_Number lua_tonumberx(lua_State *L, int idx, int *pisnum)
LUA_API const char * lua_getupvalue(lua_State *L, int funcindex, int n)
LUA_API int lua_iscfunction(lua_State *L, int idx)
LUA_API lua_Alloc lua_getallocf(lua_State *L, void **ud)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
LUA_API void lua_seti(lua_State *L, int idx, lua_Integer n)
LUA_API int lua_pushthread(lua_State *L)
LUA_API int lua_toboolean(lua_State *L, int idx)
LUA_API void lua_settable(lua_State *L, int idx)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
LUA_API int lua_rawget(lua_State *L, int idx)
LUA_API void lua_pushboolean(lua_State *L, int b)
LUA_API const lua_Number * lua_version(lua_State *L)
LUA_API int lua_compare(lua_State *L, int index1, int index2, int op)
LUA_API const char * lua_tolstring(lua_State *L, int idx, size_t *len)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUA_API int lua_pcallk(lua_State *L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k)
LUA_API int lua_geti(lua_State *L, int idx, lua_Integer n)
LUA_API int lua_type(lua_State *L, int idx)
LUA_API int lua_dump(lua_State *L, lua_Writer writer, void *data, int strip)
#define checkresults(L, na, nr)
LUA_API int lua_error(lua_State *L)
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
LUA_API void lua_rawseti(lua_State *L, int idx, lua_Integer n)
static TValue * index2addr(lua_State *L, int idx)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
LUA_API const char * lua_pushvfstring(lua_State *L, const char *fmt, va_list argp)
static const char * aux_upvalue(StkId fi, int n, TValue **val, CClosure **owner, UpVal **uv)
LUA_API void lua_pushlightuserdata(lua_State *L, void *p)
LUA_API int lua_getfield(lua_State *L, int idx, const char *k)
LUA_API lua_CFunction lua_atpanic(lua_State *L, lua_CFunction panicf)
LUA_API lua_State * lua_tothread(lua_State *L, int idx)
LUA_API int lua_isnumber(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_isstring(lua_State *L, int idx)
LUA_API const void * lua_topointer(lua_State *L, int idx)
LUA_API int lua_gettable(lua_State *L, int idx)
LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode)
LUA_API int lua_isuserdata(lua_State *L, int idx)
LUA_API int lua_next(lua_State *L, int idx)
LUA_API int lua_status(lua_State *L)
static void growstack(lua_State *L, void *ud)
LUA_API void * lua_upvalueid(lua_State *L, int fidx, int n)
LUA_API size_t lua_stringtonumber(lua_State *L, const char *s)
LUA_API int lua_isinteger(lua_State *L, int idx)
LUA_API void * lua_touserdata(lua_State *L, int idx)
static void f_call(lua_State *L, void *ud)
LUA_API void lua_callk(lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k)
LUA_API void lua_setallocf(lua_State *L, lua_Alloc f, void *ud)
LUA_API int lua_rawequal(lua_State *L, int index1, int index2)
LUA_API int lua_rawgetp(lua_State *L, int idx, const void *p)
LUA_API const char * lua_setupvalue(lua_State *L, int funcindex, int n)
LUA_API void lua_settop(lua_State *L, int idx)
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
LUA_API const char * lua_typename(lua_State *L, int t)
static UpVal ** getupvalref(lua_State *L, int fidx, int n)
LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
LUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx)
LUA_API void lua_rawsetp(lua_State *L, int idx, const void *p)
LUA_API void lua_rotate(lua_State *L, int idx, int n)
LUA_API lua_Integer lua_tointegerx(lua_State *L, int idx, int *pisnum)
LUA_API int lua_rawgeti(lua_State *L, int idx, lua_Integer n)
LUA_API int lua_gc(lua_State *L, int what, int data)
LUA_API void lua_rawset(lua_State *L, int idx)
LUA_API int lua_gettop(lua_State *L)
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
void luaC_upvdeccount(lua_State *L, UpVal *uv)
#define luaC_upvalbarrier(L, uv)
void luaO_tostring(lua_State *L, StkId obj)
size_t luaO_str2num(const char *s, TValue *o)
#define getuservalue(L, u, o)
#define ttisfulluserdata(o)
#define setuservalue(L, u, o)
#define setfltvalue(obj, x)
#define setivalue(obj, x)
LUA_KCONTEXT lua_KContext
int(* lua_KFunction)(lua_State *L, int status, lua_KContext ctx)
void luaV_finishget(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
int luaV_equalobj(lua_State *L, const TValue *t1, const TValue *t2)
void luaV_finishset(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
#define luaV_fastget(L, t, k, slot, f)
#define luaV_fastset(L, t, k, slot, f, v)
#define luaV_gettable(L, t, k, v)
#define luaV_settable(L, t, k, v)
#define lua_newuserdata(L, s)
#define lua_setuservalue(L, idx)
#define lua_getuservalue(L, idx)
CURL_EXTERN CURLMcode curl_socket_t s
struct CallInfo::@64::@66 c