aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_internal.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-28 17:17:23 +0200
committerMax Kellermann <max@duempel.org>2009-07-28 17:17:23 +0200
commitf78366910e88948dd7ef57f96933eac0377745c7 (patch)
treedbb61309713a23dbfca1e6a008ed2e828a163c67 /src/client_internal.h
parentc426bbcf954889883859bdefdb84496416810090 (diff)
downloadmpd-f78366910e88948dd7ef57f96933eac0377745c7.tar.gz
mpd-f78366910e88948dd7ef57f96933eac0377745c7.tar.xz
mpd-f78366910e88948dd7ef57f96933eac0377745c7.zip
client: splitted client.c into several pieces
The soure file client.c has nearly 1000 lines, time for splitting it into smaller pieces to improve readability.
Diffstat (limited to '')
-rw-r--r--src/client_internal.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/client_internal.h b/src/client_internal.h
index 630da59c2..91e360fe0 100644
--- a/src/client_internal.h
+++ b/src/client_internal.h
@@ -21,6 +21,10 @@
#define MPD_CLIENT_INTERNAL_H
#include "client.h"
+#include "command.h"
+
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "client"
struct deferred_buffer {
size_t size;
@@ -65,4 +69,77 @@ struct client {
unsigned idle_subscriptions;
};
+extern unsigned int client_max_connections;
+extern int client_timeout;
+extern size_t client_max_command_list_size;
+extern size_t client_max_output_buffer_size;
+
+bool
+client_list_is_empty(void);
+
+bool
+client_list_is_full(void);
+
+struct client *
+client_list_get_first(void);
+
+void
+client_list_add(struct client *client);
+
+void
+client_list_foreach(GFunc func, gpointer user_data);
+
+void
+client_list_remove(struct client *client);
+
+void
+client_close(struct client *client);
+
+static inline void
+new_cmd_list_ptr(struct client *client, const char *s)
+{
+ client->cmd_list = g_slist_prepend(client->cmd_list, g_strdup(s));
+}
+
+static inline void
+free_cmd_list(GSList *list)
+{
+ for (GSList *tmp = list; tmp != NULL; tmp = g_slist_next(tmp))
+ g_free(tmp->data);
+
+ g_slist_free(list);
+}
+
+void
+client_set_expired(struct client *client);
+
+/**
+ * Schedule an "expired" check for all clients: permanently delete
+ * clients which have been set "expired" with client_set_expired().
+ */
+void
+client_schedule_expire(void);
+
+/**
+ * Removes a scheduled "expired" check.
+ */
+void
+client_deinit_expire(void);
+
+enum command_return
+client_read(struct client *client);
+
+enum command_return
+client_process_line(struct client *client, char *line);
+
+void
+client_write_deferred(struct client *client);
+
+void
+client_write_output(struct client *client);
+
+gboolean
+client_in_event(GIOChannel *source, GIOCondition condition,
+ gpointer data);
+
#endif