Home
last modified time | relevance | path

Searched refs:L (Results 1 – 25 of 63) sorted by relevance

123

/redis-3.2.3/deps/lua/src/
H A Dlbaselib.c58 lua_pushnumber(L, lua_tonumber(L, 1)); in luaB_tonumber()
118 if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); in getfunc()
164 lua_pushboolean(L, lua_rawequal(L, 1, 2)); in luaB_rawequal()
188 lua_pushinteger(L, lua_getgccount(L)); in luaB_gcinfo()
221 lua_pushstring(L, luaL_typename(L, 1)); in luaB_type()
402 lua_pushstring(L, lua_tostring(L, 1)); in luaB_tostring()
414 lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1)); in luaB_tostring()
547 r = auxresume(L, co, lua_gettop(L) - 1); in luaB_coresume()
563 int r = auxresume(L, co, lua_gettop(L)); in luaB_auxwrap()
578 luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, in luaB_cocreate()
[all …]
H A Dldo.c82 L->ci = L->base_ci; in resetstack()
83 L->base = L->ci->base; in resetstack()
104 G(L)->panic(L); in luaD_throw()
129 L->top = (L->top - oldstack) + L->stack; in correctstack()
137 L->base = (L->base - oldstack) + L->stack; in correctstack()
156 L->ci = (L->ci - oldci) + L->base_ci; in luaD_reallocCI()
157 L->end_ci = L->base_ci + L->size_ci - 1; in luaD_reallocCI()
261 ((L->ci == L->end_ci) ? growCI(L) : \
405 luaV_execute(L, cast_int(L->ci - L->base_ci)); in resume()
411 setsvalue2s(L, L->top, luaS_new(L, msg)); in resume_error()
[all …]
H A Dlapi.c41 #define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) argument
45 #define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;} argument
52 api_check(L, idx <= L->ci->top - L->base); in index2adr()
57 api_check(L, idx != 0 && -idx <= L->top - L->base); in index2adr()
90 setobj2s(L, L->top, o); in luaA_pushobject()
167 api_check(L, idx <= L->stack_last - L->base); in lua_settop()
173 api_check(L, -(idx+1) <= (L->top - L->base)); in lua_settop()
221 luaC_barrier(L, curr_func(L), L->top - 1); in lua_replace()
230 setobj2s(L, L->top, index2adr(L, idx)); in lua_pushvalue()
521 setthvalue(L, L->top, L); in lua_pushthread()
[all …]
H A Dltablib.c19 #define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) argument
24 int n = aux_getn(L, 1); in foreachi()
30 lua_call(L, 2, 1); in foreachi()
47 lua_call(L, 2, 1); in foreach()
73 lua_pushinteger(L, aux_getn(L, 1)); in getn()
81 luaL_setn(L, 1, luaL_checkint(L, 2)); in setn()
129 lua_pushnil(L); in tremove()
151 last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1)); in tconcat()
186 lua_pop(L, 1); in sort_comp()
226 while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { in auxsort()
[all …]
H A Dliolib.c37 lua_pushnil(L); in pushresult()
50 luaL_argerror(L, arg, lua_tostring(L, -1)); in fileerror()
54 #define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) argument
99 lua_pushnil(L); in io_noclose()
130 return (lua_tocfunction(L, -1))(L); in aux_close()
260 aux_lines(L, lua_gettop(L), 1); in io_lines()
382 return g_read(L, getiofile(L, IO_INPUT), 1); in io_read()
387 return g_read(L, tofile(L), 2); in f_read()
433 return g_write(L, getiofile(L, IO_OUTPUT), 1); in io_write()
438 return g_write(L, tofile(L), 2); in f_write()
[all …]
H A Dlmathlib.c27 lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); in math_abs()
32 lua_pushnumber(L, sin(luaL_checknumber(L, 1))); in math_sin()
37 lua_pushnumber(L, sinh(luaL_checknumber(L, 1))); in math_sinh()
42 lua_pushnumber(L, cos(luaL_checknumber(L, 1))); in math_cos()
47 lua_pushnumber(L, cosh(luaL_checknumber(L, 1))); in math_cosh()
52 lua_pushnumber(L, tan(luaL_checknumber(L, 1))); in math_tan()
57 lua_pushnumber(L, tanh(luaL_checknumber(L, 1))); in math_tanh()
77 lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); in math_atan2()
92 lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); in math_fmod()
110 lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); in math_pow()
[all …]
H A Dldblib.c29 luaL_checkany(L, 1); in db_getmetatable()
41 lua_settop(L, 2); in db_setmetatable()
42 lua_pushboolean(L, lua_setmetatable(L, 1)); in db_setmetatable()
49 lua_getfenv(L, 1); in db_getfenv()
56 lua_settop(L, 2); in db_setfenv()
83 return L; in getthread()
89 if (L == L1) { in treatstackoption()
184 name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); in auxupvalue()
212 lua_pushlightuserdata(L, L); in hookf()
368 lua_concat(L, lua_gettop(L) - arg); in db_errorfb()
[all …]
H A Dloadlib.c106 luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff); in setprogdir()
269 lua_pop(L, 1); in ll_register()
316 lua_pushnil(L); in ll_loadlib()
376 lua_tostring(L, 1), filename, lua_tostring(L, -1)); in loaderror()
422 filename = findfile(L, lua_tostring(L, -1), "cpath"); in loader_Croot()
515 lua_pop(L, 1); in setfenv()
560 lua_pop(L, 1); in ll_module()
562 lua_pop(L, 1); in ll_module()
566 setfenv(L); in ll_module()
604 setprogdir(L); in setpath()
[all …]
H A Dlauxlib.c69 luaL_typerror(L, narg, lua_typename(L, tag)); in tag_error()
116 lua_pop(L, 1); in luaL_newmetatable()
312 getsizes(L); in luaL_setn()
412 lua_State *L = B->L; in adjuststack() local
455 lua_State *L = B->L; in luaL_addvalue() local
473 B->L = L; in luaL_buffinit()
531 (void)L; in getF()
581 status = lua_load(L, getF, &lf, lua_tostring(L, -1)); in luaL_loadfile()
601 (void)L; in getS()
649 if (L) lua_atpanic(L, &panic); in luaL_newstate()
[all …]
H A Dlstate.c73 stack_init(L, L); /* init stack */ in f_luaopen()
74 sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */ in f_luaopen()
75 sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */ in f_luaopen()
85 G(L) = g; in preinit_state()
96 L->nCcalls = L->baseCcalls = 0; in preinit_state()
98 L->base_ci = L->ci = NULL; in preinit_state()
111 luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); in close_state()
113 freestack(L, L); in close_state()
206 L->ci = L->base_ci; in lua_close()
207 L->base = L->top = L->ci->base; in lua_close()
[all …]
H A Dlua.c70 lua_pop(L, 1); in report()
81 lua_pop(L, 1); in traceback()
86 lua_pop(L, 2); in traceback()
135 int status = luaL_loadfile(L, name) || docall(L, 0, 1); in dofile()
149 return report(L, docall(L, 1, 1)); in dolibrary()
202 status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin"); in loadline()
226 if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0) in dotty()
345 globalL = L; in pmain()
365 dotty(L); in pmain()
369 dotty(L); in pmain()
[all …]
H A Dloslib.c26 lua_pushboolean(L, 1); in os_pushresult()
30 lua_pushnil(L); in os_pushresult()
32 lua_pushinteger(L, en); in os_pushresult()
39 lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); in os_execute()
69 lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ in os_getenv()
103 res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); in getboolfield()
104 lua_pop(L, 1); in getboolfield()
119 lua_pop(L, 1); in getfield()
135 lua_pushnil(L); in os_date()
188 lua_pushnil(L); in os_time()
[all …]
H A Dlua.h254 #define lua_pop(L,n) lua_settop(L, -(n)-1) argument
256 #define lua_newtable(L) lua_createtable(L, 0, 0) argument
258 #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) argument
260 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) argument
262 #define lua_strlen(L,i) lua_objlen(L, (i)) argument
265 #define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) argument
267 #define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) argument
270 #define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) argument
271 #define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) argument
279 #define lua_tostring(L,i) lua_tolstring(L, (i), NULL) argument
[all …]
H A Dlauxlib.h22 #define luaL_getn(L,i) ((int)lua_objlen(L, i)) argument
102 #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) argument
104 #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) argument
105 #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) argument
106 #define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) argument
107 #define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) argument
109 #define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) argument
112 (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
115 (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
119 #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) argument
[all …]
H A Dlua_cmsgpack.c35 #define lua_pushunsigned(L, n) lua_pushnumber(L, n) argument
37 #define lua_pushunsigned(L, n) lua_pushinteger(L, n) argument
403 lua_pushnil(L); in mp_encode_lua_table_as_map()
411 lua_pushnil(L); in mp_encode_lua_table_as_map()
436 lua_pushnil(L); in table_is_an_array()
445 if (!lua_isinteger(L,-1) || (n = lua_tointeger(L, -1)) <= 0) in table_is_an_array()
503 lua_pop(L,1); in mp_encode_lua_type()
549 lua_newtable(L); in mp_decode_to_lua_array()
560 lua_newtable(L); in mp_decode_to_lua_hash()
846 lua_pop(L, lua_gettop(L)-1); in mp_unpack_one()
[all …]
H A Dlvm.c54 setsvalue2s(L, obj, luaS_new(L, s)); in luaV_tostring()
83 setobj2s(L, L->top, f); /* push function */ in callTMres()
88 luaD_call(L, L->top - 3, 1); in callTMres()
91 setobjs2s(L, res, L->top); in callTMres()
104 luaD_call(L, L->top - 4, 0); in callTM()
198 callTMres(L, L->top, tm1, p1, p2); in call_orderTM()
403 lua_assert(base == L->base && L->base == L->ci->base); in luaV_execute()
404 lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); in luaV_execute()
648 if (b) L->top = L->ci->top; in luaV_execute()
688 L->top = L->ci->top; in luaV_execute()
[all …]
H A Dldo.h16 #define luaD_checkstack(L,n) \ argument
17 if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
18 luaD_growstack(L, n); \
19 else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
22 #define incr_top(L) {luaD_checkstack(L,1); L->top++;} argument
24 #define savestack(L,p) ((char *)(p) - (char *)L->stack) argument
25 #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) argument
27 #define saveci(L,p) ((char *)(p) - (char *)L->base_ci) argument
28 #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) argument
38 typedef void (*Pfunc) (lua_State *L, void *ud);
[all …]
H A Dlstrlib.c31 lua_pushinteger(L, l); in str_len()
61 luaL_buffinit(L, &b); in str_reverse()
73 luaL_buffinit(L, &b); in str_lower()
141 (void)L; in writer()
150 lua_settop(L, 1); in str_dump()
173 lua_State *L; member
516 ms.L = L; in str_find_aux()
554 ms.L = L; in gmatch_aux()
614 lua_State *L = ms->L; in add_value() local
635 lua_pop(L, 1); in add_value()
[all …]
H A Dlua_struct.c42 #define luaL_register(L,n,f) luaL_newlib(L,f) argument
163 luaL_argerror(L, 1, msg); in controloptions()
216 luaL_buffinit(L, &b); in b_pack()
300 lua_settop(L, 2); in b_unpack()
312 lua_pushnumber(L, res); in b_unpack()
322 lua_pushnumber(L, f); in b_unpack()
329 lua_pushnumber(L, d); in b_unpack()
337 lua_pop(L, 1); in b_unpack()
355 lua_pushinteger(L, pos + 1); in b_unpack()
356 return lua_gettop(L) - 2; in b_unpack()
[all …]
H A Dldebug.c87 lua_lock(L); in lua_getstack()
88 for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) { in lua_getstack()
118 StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; in findlocal()
143 setobjs2s(L, ci->base + (n - 1), L->top - 1); in lua_setlocal()
187 sethvalue(L, L->top, t); in collectvalidlines()
252 else setclvalue(L, L->top, f); in lua_getinfo()
571 getobjname(L, L->ci, cast_int(o - L->base), &name) : in luaG_typeerror()
620 StkId errfunc = restorestack(L, L->errfunc); in luaG_errormsg()
622 setobjs2s(L, L->top, L->top - 1); /* move argument */ in luaG_errormsg()
625 luaD_call(L, L->top - 2, 1); /* call it */ in luaG_errormsg()
[all …]
H A Dluaconf.h281 #define lua_freeline(L,b) ((void)L, free(b)) argument
287 #define lua_freeline(L,b) { (void)L; (void)b; } argument
379 #define luai_apicheck(L,o) { (void)L; assert(o); } argument
381 #define luai_apicheck(L,o) { (void)L; } argument
675 #define lua_popen(L,c,m) ((void)L, _popen(c,m)) argument
723 #define luai_userstateopen(L) ((void)L) argument
724 #define luai_userstateclose(L) ((void)L) argument
725 #define luai_userstatethread(L,L1) ((void)L) argument
726 #define luai_userstatefree(L) ((void)L) argument
727 #define luai_userstateresume(L,n) ((void)L) argument
[all …]
H A Dlmem.h19 #define luaM_reallocv(L,b,on,n,e) \ argument
21 luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
22 luaM_toobig(L))
24 #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) argument
25 #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) argument
26 #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) argument
28 #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) argument
29 #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) argument
30 #define luaM_newvector(L,n,t) \ argument
37 #define luaM_reallocvector(L, v,oldn,n,t) \ argument
[all …]
H A Dlua_bit.c62 bn.n = lua_tonumber(L, idx); in barg()
96 static int bit_tobit(lua_State *L) { BRET(barg(L, 1)) } in bit_tobit() argument
97 static int bit_bnot(lua_State *L) { BRET(~barg(L, 1)) } in bit_bnot() argument
100 static int func(lua_State *L) { int i; UBits b = barg(L, 1); \
101 for (i = lua_gettop(L); i > 1; i--) b opr barg(L, i); BRET(b) }
113 UBits b = barg(L, 1); UBits n = barg(L, 2) & 31; BRET(fn(b, n)) }
122 UBits b = barg(L, 1); in BIT_SH()
129 UBits b = barg(L, 1); in bit_tohex()
130 SBits n = lua_isnone(L, 2) ? 8 : (SBits)barg(L, 2); in bit_tohex()
167 b = barg(L, -1); in luaopen_bit()
[all …]
H A Dlobject.c105 setsvalue2s(L, L->top, luaS_new(L, str)); in pushstr()
106 incr_top(L); in pushstr()
113 pushstr(L, ""); in luaO_pushvfstring()
117 setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt)); in luaO_pushvfstring()
118 incr_top(L); in luaO_pushvfstring()
123 pushstr(L, s); in luaO_pushvfstring()
135 incr_top(L); in luaO_pushvfstring()
140 incr_top(L); in luaO_pushvfstring()
165 pushstr(L, fmt); in luaO_pushvfstring()
166 luaV_concat(L, n+1, cast_int(L->top - L->base) - 1); in luaO_pushvfstring()
[all …]
/redis-3.2.3/deps/lua/etc/
H A Dmin.c12 static int print(lua_State *L) in print() argument
14 int n=lua_gettop(L); in print()
19 if (lua_isstring(L,i)) in print()
20 printf("%s",lua_tostring(L,i)); in print()
21 else if (lua_isnil(L,i)) in print()
23 else if (lua_isboolean(L,i)) in print()
26 printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); in print()
34 lua_State *L=lua_open(); in main() local
35 lua_register(L,"print",print); in main()
36 if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); in main()
[all …]

123