Commit 8eb37cc0 8eb37cc0d563ee78a7b20389812edc4fb7c01fba by Sergey Poznyakoff

* 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.
1 parent fdf9bec6
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.
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......