From 9daf6a0e6b461c6c2a16f810f722b9d10504bf90 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Wed, 10 Jun 2020 13:28:41 +0200 Subject: Introduce a common task buffer and convert cfgdir and rcon to use it --- main.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.h') diff --git a/main.h b/main.h index 086cd92..a3b5512 100644 --- a/main.h +++ b/main.h @@ -24,6 +24,13 @@ 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); + +struct uring_task_buf { + char buf[4096]; + size_t len; + size_t done; +}; struct uring_task { const char *name; @@ -32,7 +39,10 @@ struct uring_task { void *parent; 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 cfg { -- cgit v1.2.3