support passing args to request handle for elimination of global var

This commit is contained in:
Rongsong Shen 2025-12-11 17:07:51 +08:00
parent 79124c6e5c
commit 486b38d679
8 changed files with 120 additions and 19 deletions

View file

@ -9,7 +9,10 @@
#include "xce/types.h"
#include "xceapi.h"
typedef int (*xce_request_handler_t)(xce_request_t*);
#if 0
typedef int (*xce_request_handler_t)(xce_request_t*, void*);
#endif
typedef void* xcecli_ctx_t;
#define N_MAX_MASTERS (3)
@ -26,7 +29,7 @@ typedef struct {
extern int xcecli_ctx_init(xcecli_ctx_t*, xce_client_config_t*);
extern void xcecli_ctx_fini(xcecli_ctx_t);
extern int xcecli_set_handler(xcecli_ctx_t, xce_request_handler_t);
extern int xcecli_set_handler(xcecli_ctx_t, xce_request_handler_t, void*);
extern int xcecli_start(xcecli_ctx_t);
extern int xcecli_stop(xcecli_ctx_t);
extern int xcecli_wakeup(xcecli_ctx_t, int);