aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/command.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/command.h b/src/command.h
index 0ab44c1..90facbb 100644
--- a/src/command.h
+++ b/src/command.h
@@ -12,8 +12,7 @@
#include <stddef.h>
-typedef int (*cmd_handler)(int conn_fd, const struct msg *request, struct msg **response,
- void *ctx);
+typedef int (*cmd_handler)(const struct msg *request, struct msg **response, void *ctx);
struct cmd_desc {
char *name;
@@ -26,7 +25,13 @@ int cmd_dispatcher_create(struct cmd_dispatcher **, struct cmd_desc *, size_t nu
void *ctx);
void cmd_dispatcher_destroy(struct cmd_dispatcher *);
-int cmd_dispatcher_handle_msg(const struct cmd_dispatcher *, int conn_fd, const struct msg *);
+int cmd_dispatcher_handle(const struct cmd_dispatcher *, const struct msg *command,
+ struct msg **response);
+
+struct cmd_conn_ctx {
+ int fd;
+ void *arg;
+};
/* This is supposed to be used as an argument to tcp_server_accept. */
int cmd_dispatcher_handle_conn(int conn_fd, void *dispatcher);