From 8b1b82b36374e95bcef8195fcd15e4014e73567d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2008 09:36:42 +0200 Subject: client: pass the client struct to processCommand() Start exporting the client struct as an opaque struct. For now, pass it only to processCommand() and processListOfCommands(), and provide a function to extract the socket handle. Later, we will propagate the pointer to all command implementations, and of course to client_print() etc. --- src/client.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index a4cb4a902..db4bc2023 100644 --- a/src/client.h +++ b/src/client.h @@ -21,6 +21,8 @@ #include "os_compat.h" +struct client; + void client_manager_init(void); void client_manager_deinit(void); int client_manager_io(void); @@ -28,6 +30,13 @@ void client_manager_expire(void); void client_new(int fd, const struct sockaddr *addr); +/** + * Return the file descriptor of this client's socket. This function + * will be removed once we have migrated to passing the client struct + * everywhere. + */ +int client_get_fd(struct client *client); + int client_print(int fd, const char *buffer, size_t len); #endif -- cgit v1.2.3