summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-01-16 13:42:58 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-01-16 13:42:58 +0000
commit8eb37cc0d563ee78a7b20389812edc4fb7c01fba (patch)
treeb08236ddf49d7921d33d3257d8f1352e5f644830
parentfdf9bec685a4d3f49b7b791bd305e8e8f62b72cd (diff)
downloadmailutils-8eb37cc0d563ee78a7b20389812edc4fb7c01fba.tar.gz
mailutils-8eb37cc0d563ee78a7b20389812edc4fb7c01fba.tar.bz2
* include/mailutils/acl.h, include/mailutils/debug.hm4,
mailbox/acl.c (mu_sockaddr_to_str, mu_sockaddr_to_astr) (mu_acl_check_sockaddr, mu_acl_check_inaddr): Use const pointers when appropriate.
-rw-r--r--ChangeLog5
-rw-r--r--include/mailutils/acl.h4
-rw-r--r--include/mailutils/debug.hm44
-rw-r--r--mailbox/acl.c9
4 files changed, 14 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 6690e743a..c400de65b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-01-16 Sergey Poznyakoff <gray@gnu.org.ua>
+ * include/mailutils/acl.h, include/mailutils/debug.hm4,
+ mailbox/acl.c (mu_sockaddr_to_str, mu_sockaddr_to_astr)
+ (mu_acl_check_sockaddr, mu_acl_check_inaddr): Use const pointers
+ when appropriate.
+
* include/mailutils/cfg.h (mu_offsetof): Move mu_offsetof to
types.hin.
* include/mailutils/types.hin (mu_offsetof): New macro.
diff --git a/include/mailutils/acl.h b/include/mailutils/acl.h
index e9edd52f2..d6f1b2b32 100644
--- a/include/mailutils/acl.h
+++ b/include/mailutils/acl.h
@@ -58,9 +58,9 @@ int mu_acl_insert (mu_acl_t acl, size_t pos, int before,
struct sockaddr *sa, int salen, unsigned long netmask);
int mu_acl_check_ipv4 (mu_acl_t acl, unsigned int addr, mu_acl_result_t *pres);
-int mu_acl_check_inaddr (mu_acl_t acl, struct in_addr *inp,
+int mu_acl_check_inaddr (mu_acl_t acl, const struct in_addr *inp,
mu_acl_result_t *pres);
-int mu_acl_check_sockaddr (mu_acl_t acl, struct sockaddr *sa, int salen,
+int mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr *sa, int salen,
mu_acl_result_t *pres);
int mu_acl_check_fd (mu_acl_t acl, int fd, mu_acl_result_t *pres);
diff --git a/include/mailutils/debug.hm4 b/include/mailutils/debug.hm4
index 12fc79c12..e43805e8c 100644
--- a/include/mailutils/debug.hm4
+++ b/include/mailutils/debug.hm4
@@ -94,10 +94,10 @@ int mu_debug_level_from_string (const char *string, mu_log_level_t *plev,
mu_debug_t debug);
struct sockaddr;
-void mu_sockaddr_to_str (struct sockaddr *sa, int salen,
+void mu_sockaddr_to_str (const struct sockaddr *sa, int salen,
char *bufptr, size_t buflen,
size_t *plen);
-char *mu_sockaddr_to_astr (struct sockaddr *sa, int salen);
+char *mu_sockaddr_to_astr (const struct sockaddr *sa, int salen);
diff --git a/mailbox/acl.c b/mailbox/acl.c
index 03710fcbe..d6dc81541 100644
--- a/mailbox/acl.c
+++ b/mailbox/acl.c
@@ -364,7 +364,7 @@ mu_stpcpy (char **pbuf, size_t *psize, const char *src)
}
void
-mu_sockaddr_to_str (struct sockaddr *sa, int salen,
+mu_sockaddr_to_str (const struct sockaddr *sa, int salen,
char *bufptr, size_t buflen,
size_t *plen)
{
@@ -405,7 +405,7 @@ mu_sockaddr_to_str (struct sockaddr *sa, int salen,
}
char *
-mu_sockaddr_to_astr (struct sockaddr *sa, int salen)
+mu_sockaddr_to_astr (const struct sockaddr *sa, int salen)
{
size_t size;
char *p;
@@ -700,7 +700,7 @@ _run_entry (void *item, void *data)
}
int
-mu_acl_check_sockaddr (mu_acl_t acl, struct sockaddr *sa, int salen,
+mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr *sa, int salen,
mu_acl_result_t *pres)
{
struct run_closure r;
@@ -736,7 +736,8 @@ mu_acl_check_sockaddr (mu_acl_t acl, struct sockaddr *sa, int salen,
}
int
-mu_acl_check_inaddr (mu_acl_t acl, struct in_addr *inp, mu_acl_result_t *pres)
+mu_acl_check_inaddr (mu_acl_t acl, const struct in_addr *inp,
+ mu_acl_result_t *pres)
{
struct sockaddr_in cs;
int len = sizeof cs;

Return to:

Send suggestions and report system problems to the System administrator.