From c405a7d93341d2c13167e8ab834c68f7b035a8bb Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 20 Jun 2020 10:56:23 +0200 Subject: Some callback naming consistency --- main.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index a47eaa6..39c2440 100644 --- a/main.h +++ b/main.h @@ -62,8 +62,8 @@ void __die(const char *fmt, ...) __attribute__((format(printf, 1, 2))); struct uring_task; /* To save typing in all the function definitions below */ -typedef void (*callback_t)(struct cfg *, struct uring_task *, int res); -typedef int (*rcallback_t)(struct cfg *, struct uring_task *, int res); +typedef void (*utask_cb_t)(struct cfg *, struct uring_task *, int res); +typedef int (*rutask_cb_t)(struct cfg *, struct uring_task *, int res); struct uring_task_buf { char buf[4096]; @@ -81,10 +81,18 @@ struct uring_task { void (*free)(struct uring_task *); bool dead; struct uring_task_buf *tbuf; - callback_t callback; - rcallback_t complete_callback; /* to check if tbuf processing is done */ - callback_t final_callback; /* once tbuf processing is done */ - struct saddr saddr; /* used for recvmsg/sendmsg */ + + /* called once or repeatedly until is_complete_cb is satisfied */ + utask_cb_t cb; + + /* returns: 0 = not complete; < 0 = error; > 0 = complete */ + rutask_cb_t is_complete_cb; + + /* called once tbuf processing is done */ + utask_cb_t final_cb; + + /* used for recvmsg/sendmsg */ + struct saddr saddr; void *priv; }; -- cgit v1.2.3