aboutsummaryrefslogtreecommitdiffstats
path: root/src/Client.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-19 19:39:40 +0200
committerMax Kellermann <max@duempel.org>2013-10-19 19:39:40 +0200
commitc2d5ce0ca213e2d25df17e080b07a3d91d330972 (patch)
tree4d7088e9e2a91408a0d5f16b247016fc125cdecc /src/Client.hxx
parent32645b80c4c6792140e312b5b9fe9f96b48c6ec7 (diff)
downloadmpd-c2d5ce0ca213e2d25df17e080b07a3d91d330972.tar.gz
mpd-c2d5ce0ca213e2d25df17e080b07a3d91d330972.tar.xz
mpd-c2d5ce0ca213e2d25df17e080b07a3d91d330972.zip
Client: move trivial functions into the Client class
Diffstat (limited to '')
-rw-r--r--src/Client.hxx49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/Client.hxx b/src/Client.hxx
index 3a2fda282..13a4a14e7 100644
--- a/src/Client.hxx
+++ b/src/Client.hxx
@@ -102,6 +102,30 @@ public:
using FullyBufferedSocket::Write;
/**
+ * returns the uid of the client process, or a negative value
+ * if the uid is unknown
+ */
+ int GetUID() const {
+ return uid;
+ }
+
+ /**
+ * Is this client running on the same machine, connected with
+ * a local (UNIX domain) socket?
+ */
+ bool IsLocal() const {
+ return uid > 0;
+ }
+
+ unsigned GetPermission() const {
+ return permission;
+ }
+
+ void SetPermission(unsigned _permission) {
+ permission = _permission;
+ }
+
+ /**
* Send "idle" response to this client.
*/
void IdleNotify();
@@ -125,31 +149,6 @@ 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
- */
-gcc_pure
-int
-client_get_uid(const Client &client);
-
-/**
- * Is this client running on the same machine, connected with a local
- * (UNIX domain) socket?
- */
-gcc_pure
-static inline bool
-client_is_local(const Client &client)
-{
- return client_get_uid(client) > 0;
-}
-
-gcc_pure
-unsigned
-client_get_permission(const Client &client);
-
-void client_set_permission(Client &client, unsigned permission);
-
-/**
* Write a C string to the client.
*/
void client_puts(Client &client, const char *s);