diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-08 03:08:14 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-08 03:08:14 +0200 |
commit | 818b53a4d442271f61edbdc08f7f47ee651821b3 (patch) | |
tree | e5c248e8de54bff1d42443edd125158111dbf882 /src/mds-server/mds-server.h | |
parent | Move mds-server into its own directory (diff) | |
download | mds-818b53a4d442271f61edbdc08f7f47ee651821b3.tar.gz mds-818b53a4d442271f61edbdc08f7f47ee651821b3.tar.bz2 mds-818b53a4d442271f61edbdc08f7f47ee651821b3.tar.xz |
split up mds-server structs into their own .h-files and add marshal functions
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-server/mds-server.h')
-rw-r--r-- | src/mds-server/mds-server.h | 125 |
1 files changed, 2 insertions, 123 deletions
diff --git a/src/mds-server/mds-server.h b/src/mds-server/mds-server.h index 1e3869f..b2dafd4 100644 --- a/src/mds-server/mds-server.h +++ b/src/mds-server/mds-server.h @@ -19,130 +19,9 @@ #define MDS_MDS_SERVER_H -#include <libmdsserver/mds-message.h> +#include "client.h" -#include <stdlib.h> -#include <pthread.h> -#include <stdint.h> - - - -/** - * A condition for a message being intercepted by a client - */ -typedef struct interception_condition -{ - /** - * The header of messages to intercept, optionally with a value, - * empty (most not be NULL) for all messages. - */ - char* condition; - - /** - * The hash of the header of messages to intercept - */ - size_t header_hash; - - /** - * The interception priority. The client should be - * consistent with the priority for conditions that - * are not mutually exclusive. - */ - int64_t priority; - - /** - * Whether the messages may get modified by the client - */ - int modifying; - -} interception_condition_t; - - -/** - * Client information structure - */ -typedef struct client -{ - /** - * The client's entry in the list of clients - */ - ssize_t list_entry; - - /** - * The socket file descriptor for the socket connected to the client - */ - int socket_fd; - - /** - * Whether the socket is open - */ - int open; - - /** - * Message read buffer for the client - */ - mds_message_t message; - - /** - * The read thread for the client - */ - pthread_t thread; - - /** - * The client's ID - */ - uint64_t id; - - /** - * Mutex for sending data and other - * actions that only affacts this client - */ - pthread_mutex_t mutex; - - /** - * The messages interception conditions conditions - * for the client - */ - interception_condition_t* interception_conditions; - - /** - * The number of interception conditions - */ - size_t interception_conditions_count; - - /** - * Messages pending to be sent (concatenated) - */ - char* send_pending; - - /** - * The character length of the messages pending to be sent - */ - size_t send_pending_size; - -} client_t; - -/** - * A queued interception - */ -typedef struct queued_interception -{ - /** - * The intercepting client - */ - client_t* client; - - /** - * The interception priority - */ - int64_t priority; - - /** - * Whether the messages may get modified by the client - */ - int modifying; - -} queued_interception_t; +#include <stddef.h> |