Lines Matching refs:rpc
94 struct evrpc *rpc; in evrpc_free() local
99 while ((rpc = TAILQ_FIRST(&base->registered_rpcs)) != NULL) { in evrpc_free()
100 r = evrpc_unregister_rpc(base, rpc->uri); in evrpc_free()
227 evrpc_register_rpc(struct evrpc_base *base, struct evrpc *rpc, in evrpc_register_rpc() argument
230 char *constructed_uri = evrpc_construct_uri(rpc->uri); in evrpc_register_rpc()
232 rpc->base = base; in evrpc_register_rpc()
233 rpc->cb = cb; in evrpc_register_rpc()
234 rpc->cb_arg = cb_arg; in evrpc_register_rpc()
236 TAILQ_INSERT_TAIL(&base->registered_rpcs, rpc, next); in evrpc_register_rpc()
241 rpc); in evrpc_register_rpc()
252 struct evrpc *rpc; in evrpc_unregister_rpc() local
256 TAILQ_FOREACH(rpc, &base->registered_rpcs, next) { in evrpc_unregister_rpc()
257 if (strcmp(rpc->uri, name) == 0) in evrpc_unregister_rpc()
260 if (rpc == NULL) { in evrpc_unregister_rpc()
264 TAILQ_REMOVE(&base->registered_rpcs, rpc, next); in evrpc_unregister_rpc()
274 mm_free((char *)rpc->uri); in evrpc_unregister_rpc()
275 mm_free(rpc); in evrpc_unregister_rpc()
286 struct evrpc *rpc = arg; in evrpc_request_cb() local
297 rpc_state->rpc = rpc; in evrpc_request_cb()
301 if (TAILQ_FIRST(&rpc->base->input_hooks) != NULL) { in evrpc_request_cb()
309 hook_res = evrpc_process_hooks(&rpc->base->input_hooks, in evrpc_request_cb()
315 evrpc_pause_request(rpc->base, rpc_state, in evrpc_request_cb()
341 struct evrpc *rpc; in evrpc_request_cb_closure() local
345 rpc = rpc_state->rpc; in evrpc_request_cb_closure()
352 rpc_state->request = rpc->request_new(rpc->request_new_arg); in evrpc_request_cb_closure()
356 if (rpc->request_unmarshal( in evrpc_request_cb_closure()
364 rpc_state->reply = rpc->reply_new(rpc->reply_new_arg); in evrpc_request_cb_closure()
369 rpc->cb(rpc_state, rpc->cb_arg); in evrpc_request_cb_closure()
384 struct evrpc *rpc; in evrpc_reqstate_free() local
386 rpc = rpc_state->rpc; in evrpc_reqstate_free()
392 rpc->request_free(rpc_state->request); in evrpc_reqstate_free()
394 rpc->reply_free(rpc_state->reply); in evrpc_reqstate_free()
407 struct evrpc *rpc; in evrpc_request_done() local
412 rpc = rpc_state->rpc; in evrpc_request_done()
414 if (rpc->reply_complete(rpc_state->reply) == -1) { in evrpc_request_done()
425 rpc->reply_marshal(rpc_state->rpc_data, rpc_state->reply); in evrpc_request_done()
427 if (TAILQ_FIRST(&rpc->base->output_hooks) != NULL) { in evrpc_request_done()
433 hook_res = evrpc_process_hooks(&rpc->base->output_hooks, in evrpc_request_done()
439 if (evrpc_pause_request(rpc->base, rpc_state, in evrpc_request_done()
1114 struct evrpc* rpc = (struct evrpc *)mm_calloc(1, sizeof(struct evrpc)); in evrpc_register_object() local
1115 if (rpc == NULL) in evrpc_register_object()
1117 rpc->uri = mm_strdup(name); in evrpc_register_object()
1118 if (rpc->uri == NULL) { in evrpc_register_object()
1119 mm_free(rpc); in evrpc_register_object()
1122 rpc->request_new = req_new; in evrpc_register_object()
1123 rpc->request_new_arg = req_new_arg; in evrpc_register_object()
1124 rpc->request_free = req_free; in evrpc_register_object()
1125 rpc->request_unmarshal = req_unmarshal; in evrpc_register_object()
1126 rpc->reply_new = rpl_new; in evrpc_register_object()
1127 rpc->reply_new_arg = rpl_new_arg; in evrpc_register_object()
1128 rpc->reply_free = rpl_free; in evrpc_register_object()
1129 rpc->reply_complete = rpl_complete; in evrpc_register_object()
1130 rpc->reply_marshal = rpl_marshal; in evrpc_register_object()
1131 return (rpc); in evrpc_register_object()
1143 struct evrpc* rpc = in evrpc_register_generic() local
1146 if (rpc == NULL) in evrpc_register_generic()
1148 evrpc_register_rpc(base, rpc, in evrpc_register_generic()