From 2835e376842facea7b7c145889ac64d413377b6c Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Sun, 7 Sep 2008 19:16:34 +0200
Subject: client: added client_[gs]et_permission()

The code in command.c shouldn't mess with a pointer to
client->permission.  Provide an API for accessing this value.
---
 src/client.c | 10 ++++++++++
 src/client.h |  4 ++++
 2 files changed, 14 insertions(+)

(limited to 'src')

diff --git a/src/client.c b/src/client.c
index 714172095..6b3be05d0 100644
--- a/src/client.c
+++ b/src/client.c
@@ -133,6 +133,16 @@ int client_is_expired(const struct client *client)
 	return client->fd < 0;
 }
 
+int client_get_permission(const struct client *client)
+{
+	return client->permission;
+}
+
+void client_set_permission(struct client *client, int permission)
+{
+	client->permission = permission;
+}
+
 static inline void client_set_expired(struct client *client)
 {
 	if (client->fd >= 0) {
diff --git a/src/client.h b/src/client.h
index f0e35bf5c..9fc6b3b76 100644
--- a/src/client.h
+++ b/src/client.h
@@ -33,6 +33,10 @@ void client_new(int fd, const struct sockaddr *addr);
 
 int client_is_expired(const struct client *client);
 
+int client_get_permission(const struct client *client);
+
+void client_set_permission(struct client *client, int permission);
+
 /**
  * Write a block of data to the client.
  */
-- 
cgit v1.2.3