Lines Matching refs:Lc

51     lua_settop(rctx->Lc, 0);  in mcp_funcgen_wait_handler()
56 lua_pushnil(rctx->Lc); in mcp_funcgen_wait_handler()
62 lua_pushinteger(rctx->Lc, rctx->wait_done); in mcp_funcgen_wait_handler()
65 lua_pushboolean(rctx->Lc, 1); in mcp_funcgen_wait_handler()
298 rc->Lc = lua_newthread(L); in _mcplib_funcgen_gencall()
299 assert(rc->Lc); in _mcplib_funcgen_gencall()
317 int res = lua_resetthread(rctx->Lc); in _mcp_funcgen_return_rctx()
328 rctx->Lc = lua_newthread(L); in _mcp_funcgen_return_rctx()
329 assert(rctx->Lc); in _mcp_funcgen_return_rctx()
332 lua_settop(rctx->Lc, 0); in _mcp_funcgen_return_rctx()
355 luaL_unref(rctx->Lc, LUA_REGISTRYINDEX, rqu->res_ref); in _mcp_funcgen_return_rctx()
360 luaL_unref(rctx->Lc, LUA_REGISTRYINDEX, rqu->req_ref); in _mcp_funcgen_return_rctx()
769 lua_rawgeti(subrctx->Lc, LUA_REGISTRYINDEX, subrctx->function_ref); in _mcplib_rcontext_queue()
770 lua_xmove(L, subrctx->Lc, 1); // move the requet object. in _mcplib_rcontext_queue()
832 mcp_resp_t *r = mcp_prep_bare_resobj(rctx->Lc, rctx->fgen->thread); in _mcp_resume_rctx_process_error()
836 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in _mcp_resume_rctx_process_error()
846 mcp_resp_t *r = mcp_prep_bare_resobj(rctx->Lc, rctx->fgen->thread); in _mcp_start_rctx_process_error()
850 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in _mcp_start_rctx_process_error()
863 int type = lua_type(rctx->Lc, 1); in mcp_start_subrctx()
865 if (type == LUA_TUSERDATA && (r = luaL_testudata(rctx->Lc, 1, "mcp.response")) != NULL) { in mcp_start_subrctx()
868 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in mcp_start_subrctx()
881 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in mcp_start_subrctx()
895 lua_pop(rctx->Lc, 1); // drop the error message. in mcp_start_subrctx()
905 int type = lua_type(rctx->Lc, 1); in mcp_resume_rctx_from_cb()
907 … if (type == LUA_TUSERDATA && (r = luaL_testudata(rctx->Lc, 1, "mcp.response")) != NULL) { in mcp_resume_rctx_from_cb()
910 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in mcp_resume_rctx_from_cb()
917 rqu->res_ref = luaL_ref(rctx->Lc, LUA_REGISTRYINDEX); in mcp_resume_rctx_from_cb()
932 lua_pop(rctx->Lc, 1); // drop the error message. in mcp_resume_rctx_from_cb()
969 lua_settop(rctx->Lc, 0); in proxy_return_rqu_dummy_cb()
970 lua_pushinteger(rctx->Lc, 0); // return a "0" done count to the function. in proxy_return_rqu_dummy_cb()
1036 lua_settop(rctx->Lc, 0); in mcp_process_rctx_wait()
1039 mcp_rcontext_push_rqu_res(rctx->Lc, rctx, handle); in mcp_process_rctx_wait()
1041 lua_pushinteger(rctx->Lc, rctx->wait_done); in mcp_process_rctx_wait()
1072 lua_settop(rctx->Lc, 0); in mcp_process_rqueue_return()
1073 lua_rawgeti(rctx->Lc, LUA_REGISTRYINDEX, rqu->cb_ref); in mcp_process_rqueue_return()
1074 lua_rawgeti(rctx->Lc, LUA_REGISTRYINDEX, rqu->res_ref); in mcp_process_rqueue_return()
1075 lua_rawgeti(rctx->Lc, LUA_REGISTRYINDEX, rqu->req_ref); in mcp_process_rqueue_return()
1076 if (lua_pcall(rctx->Lc, 2, 2, 0) != LUA_OK) { in mcp_process_rqueue_return()
1077 LOGGER_LOG(NULL, LOG_PROXYEVENTS, LOGGER_PROXY_ERROR, NULL, lua_tostring(rctx->Lc, -1)); in mcp_process_rqueue_return()
1078 } else if (lua_isinteger(rctx->Lc, 1)) { in mcp_process_rqueue_return()
1080 enum mcp_rqueue_e mode = lua_tointeger(rctx->Lc, 1); in mcp_process_rqueue_return()
1096 if (lua_toboolean(rctx->Lc, 2)) { in mcp_process_rqueue_return()
1100 lua_settop(rctx->Lc, 0); // FIXME: This might not be necessary. in mcp_process_rqueue_return()