[Pkg-gnupg-commit] [gnupg2] 05/21: tools: New function mime_maker_add_body_data.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Tue Sep 19 15:33:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit 7d15ee88980f88ca62fc7de9492dd08e54d0f0f1
Author: Werner Koch <wk at gnupg.org>
Date: Tue Sep 12 14:29:04 2017 +0200
tools: New function mime_maker_add_body_data.
* tools/mime-maker.c (mime_maker_add_body_data): New.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
tools/mime-maker.c | 13 ++++++++++++-
tools/mime-maker.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/tools/mime-maker.c b/tools/mime-maker.c
index d1241f3..0edc14d 100644
--- a/tools/mime-maker.c
+++ b/tools/mime-maker.c
@@ -478,7 +478,8 @@ add_body (mime_maker_t ctx, const void *data, size_t datalen)
/* Add STRING as body to the mail or the current MIME container. A
- * second call to this function is not allowed.
+ * second call to this function or mime_make_add_body_data is not
+ * allowed.
*
* FIXME: We may want to have an append_body to add more data to a body.
*/
@@ -489,6 +490,16 @@ mime_maker_add_body (mime_maker_t ctx, const char *string)
}
+/* Add (DATA,DATALEN) as body to the mail or the current MIME
+ * container. Note that a second call to this function or to
+ * mime_make_add_body is not allowed. */
+gpg_error_t
+mime_maker_add_body_data (mime_maker_t ctx, const void *data, size_t datalen)
+{
+ return add_body (ctx, data, datalen);
+}
+
+
/* This is the same as mime_maker_add_body but takes a stream as
* argument. As of now the stream is copied to the MIME object but
* eventually we may delay that and read the stream only at the time
diff --git a/tools/mime-maker.h b/tools/mime-maker.h
index f2a76cd..c0ddaea 100644
--- a/tools/mime-maker.h
+++ b/tools/mime-maker.h
@@ -34,6 +34,8 @@ void mime_maker_dump_tree (mime_maker_t ctx);
gpg_error_t mime_maker_add_header (mime_maker_t ctx,
const char *name, const char *value);
gpg_error_t mime_maker_add_body (mime_maker_t ctx, const char *string);
+gpg_error_t mime_maker_add_body_data (mime_maker_t ctx,
+ const void *data, size_t datalen);
gpg_error_t mime_maker_add_stream (mime_maker_t ctx, estream_t *stream_addr);
gpg_error_t mime_maker_add_container (mime_maker_t ctx);
gpg_error_t mime_maker_end_container (mime_maker_t ctx);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list