dovecot-2.2: lib-imap: API change - add const to imap_url *base ...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 27 18:19:15 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/b37e71093468
changeset: 17404:b37e71093468
user:      Phil Carmody <phil at dovecot.fi>
date:      Tue May 27 21:17:34 2014 +0300
description:
lib-imap: API change - add const to imap_url *base parameter
We do not change what's there, therefore we can promise to not change what
is there.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib-imap/imap-url.c |  8 ++++----
 src/lib-imap/imap-url.h |  2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r c94d57a3aba3 -r b37e71093468 src/lib-imap/imap-url.c
--- a/src/lib-imap/imap-url.c	Tue May 27 21:17:34 2014 +0300
+++ b/src/lib-imap/imap-url.c	Tue May 27 21:17:34 2014 +0300
@@ -119,7 +119,7 @@
 	enum imap_url_parse_flags flags;
 
 	struct imap_url *url;
-	struct imap_url *base;
+	const struct imap_url *base;
 
 	unsigned int relative:1;
 };
@@ -504,7 +504,7 @@
 
 	/* Resolve relative URI path; determine what to copy from the base URI */
 	if (url != NULL && url_parser->base != NULL && relative > 0) {
-		struct imap_url *base = url_parser->base;
+		const struct imap_url *base = url_parser->base;
 		int rel = relative;
 
 		/* /;PARTIAL= */
@@ -857,7 +857,7 @@
 			return FALSE;
 		} else if (url_parser->url != NULL) {
 			struct imap_url *url = url_parser->url;
-			struct imap_url *base = url_parser->base;
+			const struct imap_url *base = url_parser->base;
 
 			url->host_name = p_strdup_empty(parser->pool, base->host_name); 
 			url->host_ip = base->host_ip;
@@ -914,7 +914,7 @@
 
 /* Public API */
 
-int imap_url_parse(const char *url, struct imap_url *base,
+int imap_url_parse(const char *url, const struct imap_url *base,
 		   enum imap_url_parse_flags flags,
 		   struct imap_url **url_r, const char **error_r)
 {
diff -r c94d57a3aba3 -r b37e71093468 src/lib-imap/imap-url.h
--- a/src/lib-imap/imap-url.h	Tue May 27 21:17:34 2014 +0300
+++ b/src/lib-imap/imap-url.h	Tue May 27 21:17:34 2014 +0300
@@ -56,7 +56,7 @@
 };
 
 /* Parses full IMAP URL. The returned URL is allocated from data stack. */
-int imap_url_parse(const char *url, struct imap_url *base,
+int imap_url_parse(const char *url, const struct imap_url *base,
 		   enum imap_url_parse_flags flags,
 		   struct imap_url **url_r, const char **error_r);
 


More information about the dovecot-cvs mailing list