summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-08-06 21:13:17 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-08-06 21:23:26 +0300
commit6b4df0a20f5a18a4be266fade0a4979a4decf23b (patch)
treed11b72596c97a77e5c1f4b5171496c254f30100d /include
parentad04463ee93ebd10a65fe9e128919a2dd735a534 (diff)
downloadmailutils-6b4df0a20f5a18a4be266fade0a4979a4decf23b.tar.gz
mailutils-6b4df0a20f5a18a4be266fade0a4979a4decf23b.tar.bz2
decodemail: make sure each message has the final newline on its own
* include/mailutils/stream.h (mu_stream_copy_wcb) (mu_stream_copy_nl): New protos. * libmailutils/stream/streamcpy.c (mu_stream_copy_wcb) (mu_stream_copy_nl): New functions. * libproto/mbox/mbox.c (append_message_to_stream): Use mu_stream_copy_nl. * decodemail/decodemail.c (hdr_print, body_print): Remove. (message_store_stdout): Use message stream instead of piping header and body separately. Use mu_stream_copy_nl to ensure the message has a final newline.
Diffstat (limited to 'include')
-rw-r--r--include/mailutils/stream.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mailutils/stream.h b/include/mailutils/stream.h
index 4843dc178..a91f168de 100644
--- a/include/mailutils/stream.h
+++ b/include/mailutils/stream.h
@@ -371,6 +371,12 @@ int mu_stream_printf (mu_stream_t stream, const char *fmt, ...)
int mu_stream_copy (mu_stream_t dst, mu_stream_t src, mu_off_t size,
mu_off_t *pcsz);
+int mu_stream_copy_wcb (mu_stream_t dst, mu_stream_t src, mu_off_t size,
+ void (*cbf) (char *, size_t, void *), void *cbd,
+ mu_off_t *pcsz);
+int mu_stream_copy_nl (mu_stream_t dst, mu_stream_t src, mu_off_t size,
+ mu_off_t *pcsz);
+
int mu_stream_header_copy (mu_stream_t dst, mu_stream_t src, char **exclude_names);
int mu_stream_shift (mu_stream_t str, mu_off_t off_a, mu_off_t off_b,

Return to:

Send suggestions and report system problems to the System administrator.