diff options
author | Max Kellermann <max@duempel.org> | 2008-10-14 22:38:14 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-14 22:38:14 +0200 |
commit | a3e3d2c9506d17b3e19e205535ec263ee75178c9 (patch) | |
tree | 3e93ea6ae33dba8a8f5e12e34629366dcdd7fdb7 /src/client.h | |
parent | 30c86d8ae64ae46ba3bcb1c63e867789feab6dc4 (diff) | |
download | mpd-a3e3d2c9506d17b3e19e205535ec263ee75178c9.tar.gz mpd-a3e3d2c9506d17b3e19e205535ec263ee75178c9.tar.xz mpd-a3e3d2c9506d17b3e19e205535ec263ee75178c9.zip |
command: added command "idle"
"idle" waits until something noteworthy happens on the server,
e.g. song change, playlist modified, database updated. This allows
clients to keep up to date without polling.
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client.h b/src/client.h index 0d9f2e76a..50238d9f0 100644 --- a/src/client.h +++ b/src/client.h @@ -21,6 +21,7 @@ #include "gcc.h" +#include <stdbool.h> #include <stddef.h> #include <stdarg.h> #include <sys/socket.h> @@ -60,4 +61,17 @@ void client_vprintf(struct client *client, const char *fmt, va_list args); */ mpd_fprintf 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); + #endif |