changeset 21980:53b40f5b0626

lib-imap: Make imap_bodystructure_parse_args() public
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 24 Apr 2017 14:04:01 +0300
parents 93b58b983718
children 0b5db3e0cfc2
files src/lib-imap/imap-bodystructure.c src/lib-imap/imap-bodystructure.h
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap/imap-bodystructure.c	Mon Apr 24 12:50:10 2017 +0300
+++ b/src/lib-imap/imap-bodystructure.c	Mon Apr 24 14:04:01 2017 +0300
@@ -351,7 +351,7 @@
 	return 0;
 }
 
-static int
+int
 imap_bodystructure_parse_args(const struct imap_arg *args, pool_t pool,
 			      struct message_part **_part,
 			      const char **error_r)
--- a/src/lib-imap/imap-bodystructure.h	Mon Apr 24 12:50:10 2017 +0300
+++ b/src/lib-imap/imap-bodystructure.h	Mon Apr 24 14:04:01 2017 +0300
@@ -3,6 +3,7 @@
 
 struct message_part;
 struct message_header_line;
+struct imap_arg;
 
 /* Write a BODY/BODYSTRUCTURE from given message_part. The message_part->data
    field must be set. part->body_size.virtual_size and .lines are also used
@@ -17,6 +18,11 @@
 int imap_bodystructure_parse_full(const char *bodystructure, pool_t pool,
 			     struct message_part **parts, const char **error_r);
 
+/* Same as imap_bodystructure_parse_full(), but read the input from imap_args
+   instead of a string. */
+int imap_bodystructure_parse_args(const struct imap_arg *args, pool_t pool,
+			     struct message_part **parts, const char **error_r);
+
 /* Parse BODYSTRUCTURE and save the contents to message_part->data for each
    message tree node. The parts argument must point to an existing message_part
    tree. Returns 0 if ok, -1 if bodystructure wasn't valid. */