diff options
author | Max Kellermann <max@duempel.org> | 2012-02-13 20:00:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-13 20:05:31 +0100 |
commit | 1d66e714e6a8fef2e0b1abfe7005b259996b408c (patch) | |
tree | d0e0abc80eea8578197f16c3af02f3c6e5c4eb21 /src/client.h | |
parent | d98a863b82ade86ba538faf0ff9e11d483d681e4 (diff) | |
download | mpd-1d66e714e6a8fef2e0b1abfe7005b259996b408c.tar.gz mpd-1d66e714e6a8fef2e0b1abfe7005b259996b408c.tar.xz mpd-1d66e714e6a8fef2e0b1abfe7005b259996b408c.zip |
client: add function client_is_local()
Diffstat (limited to '')
-rw-r--r-- | src/client.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client.h b/src/client.h index 0bd02d0a3..0302a2e0a 100644 --- a/src/client.h +++ b/src/client.h @@ -45,6 +45,17 @@ bool client_is_expired(const struct client *client); 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); |