[gmime] Added g_mime_object_write_contyent_to_stream()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime] Added g_mime_object_write_contyent_to_stream()
- Date: Thu, 10 Sep 2020 14:27:43 +0000 (UTC)
commit 3efc24a6cdc88198e11e43f23e03e32f12b13bd8
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Wed Sep 9 21:44:55 2020 -0400
Added g_mime_object_write_contyent_to_stream()
Fixes issue #97
gmime/gmime-object.c | 21 ++++++++++++++++++++-
gmime/gmime-object.h | 1 +
2 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/gmime/gmime-object.c b/gmime/gmime-object.c
index 8d11cee1..861a0191 100644
--- a/gmime/gmime-object.c
+++ b/gmime/gmime-object.c
@@ -975,7 +975,7 @@ object_write_to_stream (GMimeObject *object, GMimeFormatOptions *options, gboole
* @options: (nullable): a #GMimeFormatOptions or %NULL
* @stream: stream
*
- * Write the contents of the MIME object to @stream.
+ * Write the headers and content of the MIME object to @stream.
*
* Returns: the number of bytes written or %-1 on fail.
**/
@@ -989,6 +989,25 @@ g_mime_object_write_to_stream (GMimeObject *object, GMimeFormatOptions *options,
}
+/**
+ * g_mime_object_write_content_to_stream:
+ * @object: a #GMimeObject
+ * @options: (nullable): a #GMimeFormatOptions or %NULL
+ * @stream: stream
+ *
+ * Write only the content of the MIME object to @stream.
+ *
+ * Returns: the number of bytes written or %-1 on fail.
+ **/
+ssize_t
+g_mime_object_write_content_to_stream (GMimeObject *object, GMimeFormatOptions *options, GMimeStream *stream)
+{
+ g_return_val_if_fail (GMIME_IS_OBJECT (object), -1);
+ g_return_val_if_fail (GMIME_IS_STREAM (stream), -1);
+
+ return GMIME_OBJECT_GET_CLASS (object)->write_to_stream (object, options, TRUE, stream);
+}
+
static void
object_encode (GMimeObject *object, GMimeEncodingConstraint constraint)
{
diff --git a/gmime/gmime-object.h b/gmime/gmime-object.h
index c258de57..1852c9b5 100644
--- a/gmime/gmime-object.h
+++ b/gmime/gmime-object.h
@@ -134,6 +134,7 @@ GMimeHeaderList *g_mime_object_get_header_list (GMimeObject *object);
char *g_mime_object_get_headers (GMimeObject *object, GMimeFormatOptions *options);
ssize_t g_mime_object_write_to_stream (GMimeObject *object, GMimeFormatOptions *options, GMimeStream
*stream);
+ssize_t g_mime_object_write_content_to_stream (GMimeObject *object, GMimeFormatOptions *options, GMimeStream
*stream);
char *g_mime_object_to_string (GMimeObject *object, GMimeFormatOptions *options);
void g_mime_object_encode (GMimeObject *object, GMimeEncodingConstraint constraint);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]