support passing args to request handle for elimination of global var
This commit is contained in:
parent
79124c6e5c
commit
486b38d679
8 changed files with 120 additions and 19 deletions
|
|
@ -76,7 +76,8 @@ void xcecli_ctx_fini(xcecli_ctx_t c)
|
|||
free(ctx);
|
||||
}
|
||||
|
||||
int xcecli_set_handler(xcecli_ctx_t c, xce_request_handler_t handler)
|
||||
int xcecli_set_handler(xcecli_ctx_t c, xce_request_handler_t handler,
|
||||
void* args)
|
||||
{
|
||||
api_ctx_t* ctx = (api_ctx_t*)c;
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ int xcecli_set_handler(xcecli_ctx_t c, xce_request_handler_t handler)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
return xce_ctx_set_handler(&(ctx->ctx), handler);
|
||||
return xce_ctx_set_handler(&(ctx->ctx), handler, args);
|
||||
}
|
||||
|
||||
int xcecli_wakeup(xcecli_ctx_t c, int status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue