Lines Matching full:co
17 static int auxresume (lua_State *L, lua_State *co, int narg) { in auxresume() argument
19 if (!lua_checkstack(co, narg)) { in auxresume()
23 if (lua_status(co) == LUA_OK && lua_gettop(co) == 0) { in auxresume()
27 lua_xmove(L, co, narg); in auxresume()
28 status = lua_resume(co, L, narg); in auxresume()
30 int nres = lua_gettop(co); in auxresume()
32 lua_pop(co, nres); /* remove results anyway */ in auxresume()
36 lua_xmove(co, L, nres); /* move yielded values */ in auxresume()
40 lua_xmove(co, L, 1); /* move error message */ in auxresume()
47 lua_State *co = lua_tothread(L, 1); in luaB_coresume() local
49 luaL_argcheck(L, co, 1, "coroutine expected"); in luaB_coresume()
50 r = auxresume(L, co, lua_gettop(L) - 1); in luaB_coresume()
65 lua_State *co = lua_tothread(L, lua_upvalueindex(1)); in luaB_auxwrap() local
66 int r = auxresume(L, co, lua_gettop(L)); in luaB_auxwrap()
102 lua_State *co = lua_tothread(L, 1); in luaB_costatus() local
103 luaL_argcheck(L, co, 1, "coroutine expected"); in luaB_costatus()
104 if (L == co) lua_pushliteral(L, "running"); in luaB_costatus()
106 switch (lua_status(co)) { in luaB_costatus()
112 if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ in luaB_costatus()
114 else if (lua_gettop(co) == 0) in luaB_costatus()