MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / auxstatus

Function auxstatus

lib/lua/src/lcorolib.c:127–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126
127static int auxstatus (lua_State *L, lua_State *co) {
128 if (L == co) return COS_RUN;
129 else {
130 switch (lua_status(co)) {
131 case LUA_YIELD:
132 return COS_YIELD;
133 case LUA_OK: {
134 lua_Debug ar;
135 if (lua_getstack(co, 0, &ar)) /* does it have frames? */
136 return COS_NORM; /* it is running */
137 else if (lua_gettop(co) == 0)
138 return COS_DEAD;
139 else
140 return COS_YIELD; /* initial state */
141 }
142 default: /* some error occurred */
143 return COS_DEAD;
144 }
145 }
146}
147
148
149static int luaB_costatus (lua_State *L) {

Callers 2

luaB_costatusFunction · 0.85
luaB_closeFunction · 0.85

Calls 3

lua_statusFunction · 0.85
lua_getstackFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected