aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/client.h b/src/client.h
index d46747b4f..0302a2e0a 100644
--- a/src/client.h
+++ b/src/client.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -27,20 +27,36 @@
struct client;
struct sockaddr;
+struct player_control;
void client_manager_init(void);
void client_manager_deinit(void);
-void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid);
+void client_new(struct player_control *player_control,
+ int fd, const struct sockaddr *sa, size_t sa_length, int uid);
+G_GNUC_PURE
bool client_is_expired(const struct client *client);
/**
* returns the uid of the client process, or a negative value if the
* uid is unknown
*/
+G_GNUC_PURE
int client_get_uid(const struct client *client);
+/**
+ * Is this client running on the same machine, connected with a local
+ * (UNIX domain) socket?
+ */
+G_GNUC_PURE
+static inline bool
+client_is_local(const struct client *client)
+{
+ return client_get_uid(client) > 0;
+}
+
+G_GNUC_PURE
unsigned client_get_permission(const struct client *client);
void client_set_permission(struct client *client, unsigned permission);
@@ -60,17 +76,4 @@ void client_vprintf(struct client *client, const char *fmt, va_list args);
*/
G_GNUC_PRINTF(2, 3) void client_printf(struct client *client, const char *fmt, ...);
-/**
- * Adds the specified idle flags to all clients and immediately sends
- * notifications to all waiting clients.
- */
-void client_manager_idle_add(unsigned flags);
-
-/**
- * Checks whether the client has pending idle flags. If yes, they are
- * sent immediately and "true" is returned". If no, it puts the
- * client into waiting mode and returns false.
- */
-bool client_idle_wait(struct client *client, unsigned flags);
-
#endif