Lines Matching full:l1

50 static int runC (lua_State *L, lua_State *L1, const char *pc);
439 static void checkstack (global_State *g, lua_State *L1) { in checkstack() argument
443 assert(!isdead(g, L1)); in checkstack()
444 if (L1->stack.p == NULL) { /* incomplete thread? */ in checkstack()
445 assert(L1->openupval == NULL && L1->ci == NULL); in checkstack()
448 for (uv = L1->openupval; uv != NULL; uv = uv->u.open.next) in checkstack()
450 assert(L1->top.p <= L1->stack_last.p); in checkstack()
451 assert(L1->tbclist.p <= L1->top.p); in checkstack()
452 for (ci = L1->ci; ci != NULL; ci = ci->previous) { in checkstack()
453 assert(ci->top.p <= L1->stack_last.p); in checkstack()
456 for (o = L1->stack.p; o < L1->stack_last.p; o++) in checkstack()
457 checkliveness(L1, s2v(o)); /* entire stack must have valid values */ in checkstack()
1120 lua_State *L1 = lua_newthread(L); in doonnewstack() local
1123 int status = luaL_loadbuffer(L1, s, l, s); in doonnewstack()
1125 status = lua_pcall(L1, 0, 0, 0); in doonnewstack()
1153 lua_State *L1 = lua_newstate(f, ud); in newstate() local
1154 if (L1) { in newstate()
1155 lua_atpanic(L1, tpanic); in newstate()
1156 lua_pushlightuserdata(L, L1); in newstate()
1165 lua_State *L1 = cast(lua_State *, lua_touserdata(L, 1)); in getstate() local
1166 luaL_argcheck(L, L1 != NULL, 1, "state expected"); in getstate()
1167 return L1; in getstate()
1184 lua_State *L1 = getstate(L); in loadlib() local
1186 luaL_requiref(L1, "package", luaopen_package, 0); in loadlib()
1187 lua_assert(lua_type(L1, -1) == LUA_TTABLE); in loadlib()
1189 luaL_requiref(L1, "package", NULL, 1); /* seg. fault if it reloads */ in loadlib()
1191 lua_assert(lua_compare(L1, -1, -2, LUA_OPEQ)); in loadlib()
1192 luaL_getsubtable(L1, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE); in loadlib()
1194 lua_pushcfunction(L1, libs[i].func); in loadlib()
1195 lua_setfield(L1, -2, libs[i].name); in loadlib()
1201 lua_State *L1 = getstate(L); in closestate() local
1202 lua_close(L1); in closestate()
1207 lua_State *L1 = getstate(L); in doremote() local
1211 lua_settop(L1, 0); in doremote()
1212 status = luaL_loadbuffer(L1, code, lcode, code); in doremote()
1214 status = lua_pcall(L1, 0, LUA_MULTRET, 0); in doremote()
1217 lua_pushstring(L, lua_tostring(L1, -1)); in doremote()
1223 while (!lua_isnone(L1, ++i)) in doremote()
1224 lua_pushstring(L, lua_tostring(L1, i)); in doremote()
1225 lua_pop(L1, i-1); in doremote()
1257 lua_State *L1; in checkpanic() local
1262 L1 = lua_newstate(f, ud); /* create new state */ in checkpanic()
1263 if (L1 == NULL) { /* error? */ in checkpanic()
1267 lua_atpanic(L1, panicback); /* set its panic function */ in checkpanic()
1268 lua_pushlightuserdata(L1, &b); in checkpanic()
1269 lua_setfield(L1, LUA_REGISTRYINDEX, "_jmpbuf"); /* store 'Aux' struct */ in checkpanic()
1271 runC(L, L1, code); /* run code unprotected */ in checkpanic()
1276 lua_pushstring(L, lua_tostring(L1, -1)); in checkpanic()
1278 lua_close(L1); in checkpanic()
1306 static int getnum_aux (lua_State *L, lua_State *L1, const char **pc) { in getnum_aux() argument
1311 res = cast_int(lua_tointeger(L1, -1)); in getnum_aux()
1312 lua_pop(L1, 1); in getnum_aux()
1317 res = lua_gettop(L1); in getnum_aux()
1351 static int getindex_aux (lua_State *L, lua_State *L1, const char **pc) { in getindex_aux() argument
1356 case 'U': return lua_upvalueindex(getnum_aux(L, L1, pc)); in getindex_aux()
1357 default: (*pc)--; return getnum_aux(L, L1, pc); in getindex_aux()
1380 #define getnum (getnum_aux(L, L1, &pc))
1382 #define getindex (getindex_aux(L, L1, &pc))
1398 static int runC (lua_State *L, lua_State *L1, const char *pc) { in runC() argument
1406 lua_pushnumber(L1, lua_absindex(L1, getindex)); in runC()
1410 int i = lua_rawlen(L1, t); in runC()
1411 lua_rawseti(L1, t, i + 1); in runC()
1417 lua_arith(L1, op); in runC()
1422 lua_call(L1, narg, nres); in runC()
1428 lua_callk(L1, narg, nres, i, Cfunck); in runC()
1435 luaL_checkstack(L1, sz, msg); in runC()
1439 lua_pushboolean(L1, lua_checkstack(L1, sz)); in runC()
1447 lua_pushboolean(L1, lua_compare(L1, a, b, op)); in runC()
1450 lua_concat(L1, getnum); in runC()
1454 lua_copy(L1, f, getindex); in runC()
1457 lua_CFunction func = lua_tocfunction(L1, getindex); in runC()
1458 lua_pushnumber(L1, cast_sizet(func)); in runC()
1462 lua_getfield(L1, t, getstring); in runC()
1465 lua_getglobal(L1, getstring); in runC()
1468 if (lua_getmetatable(L1, getindex) == 0) in runC()
1469 lua_pushnil(L1); in runC()
1472 lua_gettable(L1, getindex); in runC()
1475 lua_pushinteger(L1, lua_gettop(L1)); in runC()
1479 luaL_gsub(L1, lua_tostring(L1, a), in runC()
1480 lua_tostring(L1, b), in runC()
1481 lua_tostring(L1, c)); in runC()
1484 lua_insert(L1, getnum); in runC()
1487 lua_pushboolean(L1, lua_iscfunction(L1, getindex)); in runC()
1490 lua_pushboolean(L1, lua_isfunction(L1, getindex)); in runC()
1493 lua_pushboolean(L1, lua_isnil(L1, getindex)); in runC()
1496 lua_pushboolean(L1, lua_isnone(L1, getindex)); in runC()
1499 lua_pushboolean(L1, lua_isnumber(L1, getindex)); in runC()
1502 lua_pushboolean(L1, lua_isstring(L1, getindex)); in runC()
1505 lua_pushboolean(L1, lua_istable(L1, getindex)); in runC()
1508 lua_pushboolean(L1, lua_islightuserdata(L1, getindex)); in runC()
1511 lua_pushboolean(L1, lua_isuserdata(L1, getindex)); in runC()
1514 lua_len(L1, getindex); in runC()
1517 lua_pushinteger(L1, luaL_len(L1, getindex)); in runC()
1520 luaL_loadfile(L1, luaL_checkstring(L1, getnum)); in runC()
1523 const char *s = luaL_checkstring(L1, getnum); in runC()
1524 luaL_loadstring(L1, s); in runC()
1527 lua_pushboolean(L1, luaL_newmetatable(L1, getstring)); in runC()
1530 lua_newtable(L1); in runC()
1533 lua_newthread(L1); in runC()
1536 lua_pushinteger(L1, lua_resetthread(L1)); /* deprecated */ in runC()
1539 lua_newuserdata(L1, getnum); in runC()
1542 lua_next(L1, -2); in runC()
1545 lua_pushinteger(L1, lua_rawlen(L1, getindex)); in runC()
1550 status = lua_pcall(L1, narg, nres, getnum); in runC()
1556 status = lua_pcallk(L1, narg, nres, 0, i, Cfunck); in runC()
1559 lua_pop(L1, getnum); in runC()
1564 printf("%s\n", luaL_tolstring(L1, n, NULL)); in runC()
1565 lua_pop(L1, 1); in runC()
1567 else printstack(L1); in runC()
1575 lua_warning(L1, msg, 1); in runC()
1579 lua_warning(L1, msg, 0); in runC()
1582 lua_pushboolean(L1, getnum); in runC()
1585 lua_pushcclosure(L1, testC, getnum); in runC()
1588 lua_pushinteger(L1, getnum); in runC()
1591 lua_pushnil(L1); in runC()
1594 lua_pushnumber(L1, (lua_Number)getnum); in runC()
1597 lua_pushstring(L1, statcodes[status]); in runC()
1600 lua_pushstring(L1, getstring); in runC()
1603 lua_pushinteger(L1, lua_upvalueindex(getnum)); in runC()
1606 lua_pushvalue(L1, getindex); in runC()
1609 lua_pushfstring(L1, lua_tostring(L, -2), (int)lua_tointeger(L, -1)); in runC()
1612 lua_pushfstring(L1, lua_tostring(L, -2), lua_tostring(L, -1)); in runC()
1615 lua_pushfstring(L1, lua_tostring(L, -2), lua_topointer(L, -1)); in runC()
1619 lua_rawget(L1, t); in runC()
1623 lua_rawgeti(L1, t, getnum); in runC()
1627 lua_rawgetp(L1, t, cast_voidp(cast_sizet(getnum))); in runC()
1631 lua_rawset(L1, t); in runC()
1635 lua_rawseti(L1, t, getnum); in runC()
1639 lua_rawsetp(L1, t, cast_voidp(cast_sizet(getnum))); in runC()
1642 lua_remove(L1, getnum); in runC()
1645 lua_replace(L1, getindex); in runC()
1650 status = lua_resume(lua_tothread(L1, i), L, getnum, &nres); in runC()
1654 if (L1 != L) { in runC()
1658 switch (lua_type(L1, idx)) { in runC()
1660 lua_pushboolean(L, lua_toboolean(L1, idx)); in runC()
1663 lua_pushstring(L, lua_tostring(L1, idx)); in runC()
1672 lua_rotate(L1, i, getnum); in runC()
1677 lua_setfield(L1, t, s); in runC()
1681 lua_seti(L1, t, getnum); in runC()
1685 lua_setglobal(L1, s); in runC()
1691 sethookaux(L1, mask, count, s); in runC()
1695 lua_setmetatable(L1, idx); in runC()
1698 lua_settable(L1, getindex); in runC()
1701 lua_settop(L1, getnum); in runC()
1705 lua_pushboolean(L1, luaL_testudata(L1, i, getstring) != NULL); in runC()
1708 lua_error(L1); in runC()
1718 luaL_error(L1, "C++"); in runC()
1723 lua_pushboolean(L1, lua_toboolean(L1, getindex)); in runC()
1726 lua_pushcfunction(L1, lua_tocfunction(L1, getindex)); in runC()
1729 lua_pushinteger(L1, lua_tointeger(L1, getindex)); in runC()
1732 lua_pushnumber(L1, lua_tonumber(L1, getindex)); in runC()
1735 lua_pushlightuserdata(L1, cast_voidp(lua_topointer(L1, getindex))); in runC()
1738 lua_pushlightuserdata(L1, lua_touserdata(L1, getindex)); in runC()
1741 const char *s = lua_tostring(L1, getindex); in runC()
1742 const char *s1 = lua_pushstring(L1, s); in runC()
1747 luaL_tolstring(L1, getindex, NULL); in runC()
1750 lua_pushstring(L1, luaL_typename(L1, getnum)); in runC()
1755 lua_State *fs = (f == 0) ? L1 : lua_tothread(L1, f); in runC()
1756 lua_State *ts = (t == 0) ? L1 : lua_tothread(L1, t); in runC()
1762 lua_pushboolean(L1, lua_isyieldable(lua_tothread(L1, getindex))); in runC()
1765 return lua_yield(L1, getnum); in runC()
1770 return lua_yieldk(L1, nres, i, Cfunck); in runC()
1773 lua_toclose(L1, getnum); in runC()
1776 lua_closeslot(L1, getnum); in runC()
1785 lua_State *L1; in testC() local
1788 L1 = getstate(L); in testC()
1792 L1 = lua_tothread(L, 1); in testC()
1796 L1 = L; in testC()
1799 return runC(L, L1, pc); in testC()