summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-10 13:28:41 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-10 13:28:41 +0200
commit9daf6a0e6b461c6c2a16f810f722b9d10504bf90 (patch)
tree4ec8bcdce547abb458257ad1a24cf0249de17a9a /main.h
parentfae819296598100e41646e0bebc7d0bce45614f7 (diff)
Introduce a common task buffer and convert cfgdir and rcon to use it
Diffstat (limited to 'main.h')
-rw-r--r--main.h10
1 files changed, 10 insertions, 0 deletions
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 {