diff options
Diffstat (limited to '')
-rw-r--r-- | src/Client.hxx (renamed from src/client.h) | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/client.h b/src/Client.hxx index 0302a2e0a..bf2a2521f 100644 --- a/src/client.h +++ b/src/Client.hxx @@ -20,60 +20,61 @@ #ifndef MPD_CLIENT_H #define MPD_CLIENT_H -#include <glib.h> -#include <stdbool.h> +#include "gcc.h" + #include <stddef.h> #include <stdarg.h> -struct client; struct sockaddr; -struct player_control; +class EventLoop; +struct Partition; +class Client; void client_manager_init(void); void client_manager_deinit(void); -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); +void +client_new(EventLoop &loop, Partition &partition, + int fd, const struct sockaddr *sa, size_t sa_length, int uid); /** * 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); +gcc_pure +int client_get_uid(const Client *client); /** * Is this client running on the same machine, connected with a local * (UNIX domain) socket? */ -G_GNUC_PURE +gcc_pure static inline bool -client_is_local(const struct client *client) +client_is_local(const Client *client) { return client_get_uid(client) > 0; } -G_GNUC_PURE -unsigned client_get_permission(const struct client *client); +gcc_pure +unsigned client_get_permission(const Client *client); -void client_set_permission(struct client *client, unsigned permission); +void client_set_permission(Client *client, unsigned permission); /** * Write a C string to the client. */ -void client_puts(struct client *client, const char *s); +void client_puts(Client *client, const char *s); /** * Write a printf-like formatted string to the client. */ -void client_vprintf(struct client *client, const char *fmt, va_list args); +void client_vprintf(Client *client, const char *fmt, va_list args); /** * Write a printf-like formatted string to the client. */ -G_GNUC_PRINTF(2, 3) void client_printf(struct client *client, const char *fmt, ...); +gcc_fprintf +void +client_printf(Client *client, const char *fmt, ...); #endif |