diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-13 02:32:31 +0000 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-13 02:32:31 +0000 |
commit | 63b8dac4b3989a974d37ea9a5935e8b8911dbf85 (patch) | |
tree | 53eb3d89c66403ae93d4a55d5a61ded6ffe04871 | |
parent | 16315fbc55cae8389be341b0390856f62558ec9a (diff) | |
download | gmime-63b8dac4b3989a974d37ea9a5935e8b8911dbf85.tar.gz |
No longer takes a 'toplevel' argument. (g_mime_part_to_string): No longer
2001-10-12 Jeffrey Stedfast <fejj@ximian.com>
* gmime-part.c (g_mime_part_write_to_stream): No longer takes a
'toplevel' argument.
(g_mime_part_to_string): No longer takes a 'toplevel' argument.
* gmime-message.c (g_mime_message_write_to_stream): Write the
MIME-Version header here instead of needing to pass a 'toplevel'
argument to g_mime_part_write_to_stream().
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gmime-message.c | 7 | ||||
-rw-r--r-- | gmime-part.c | 32 | ||||
-rw-r--r-- | gmime-part.h | 4 | ||||
-rw-r--r-- | gmime/gmime-message.c | 7 | ||||
-rw-r--r-- | gmime/gmime-part.c | 32 | ||||
-rw-r--r-- | gmime/gmime-part.h | 4 |
7 files changed, 34 insertions, 60 deletions
@@ -1,5 +1,13 @@ 2001-10-12 Jeffrey Stedfast <fejj@ximian.com> + * gmime-part.c (g_mime_part_write_to_stream): No longer takes a + 'toplevel' argument. + (g_mime_part_to_string): No longer takes a 'toplevel' argument. + + * gmime-message.c (g_mime_message_write_to_stream): Write the + MIME-Version header here instead of needing to pass a 'toplevel' + argument to g_mime_part_write_to_stream(). + * gmime-charset.c (g_mime_charset_init): Fix for Debian and Solaris. diff --git a/gmime-message.c b/gmime-message.c index acab2c80..78d4975b 100644 --- a/gmime-message.c +++ b/gmime-message.c @@ -539,9 +539,10 @@ g_mime_message_write_to_stream (GMimeMessage *message, GMimeStream *stream) g_mime_header_write_to_stream (message->header->headers, stream); - if (message->mime_part) - g_mime_part_write_to_stream (message->mime_part, TRUE, stream); - else + if (message->mime_part) { + g_mime_stream_write_string (stream, "MIME-Version: 1.0\n"); + g_mime_part_write_to_stream (message->mime_part, stream); + } else g_mime_stream_write (stream, "\n", 1); } diff --git a/gmime-part.c b/gmime-part.c index f80e92bc..f4bde8b0 100644 --- a/gmime-part.c +++ b/gmime-part.c @@ -1073,15 +1073,12 @@ write_content (GMimePart *part, GMimeStream *stream) /** * g_mime_part_write_to_stream: Write the MIME Part to a string * @mime_part: MIME Part - * @toplevel: mime part is the root mime part * @stream: output stream * - * Writes the contents of the MIME Part to @stream. If toplevel is set - * to TRUE, then the MIME Part header will contain needed MIME headers - * for rfc822 messages. + * Writes the contents of the MIME Part to @stream. **/ void -g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStream *stream) +g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream) { g_return_if_fail (mime_part != NULL); g_return_if_fail (stream != NULL); @@ -1099,22 +1096,13 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea } content_type = get_content_type (mime_part->mime_type); - - if (toplevel) { - g_mime_stream_printf (stream, "MIME-Version: 1.0\n" - "%s\n" /* content-type */ - "This is a multi-part message in MIME format.\n\n", - content_type); - } else { - g_mime_stream_printf (stream, "%s\n", content_type); - } - + g_mime_stream_printf (stream, "%s\n", content_type); g_free (content_type); child = mime_part->children; while (child) { g_mime_stream_printf (stream, "--%s\n", boundary); - g_mime_part_write_to_stream (child->data, FALSE, stream); + g_mime_part_write_to_stream (child->data, stream); g_mime_stream_write (stream, "\n", 1); child = child->next; @@ -1130,9 +1118,6 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea char *content_location; char *text; - if (toplevel) - g_mime_stream_write_string (stream, "MIME-Version: 1.0\n"); - /* Content-Type: */ content_type = get_content_type (mime_part->mime_type); g_mime_stream_write_string (stream, content_type); @@ -1201,14 +1186,11 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea /** * g_mime_part_to_string: Write the MIME Part to a string * @mime_part: MIME Part - * @toplevel: mime part is the root mime part * - * Returns an allocated string containing the MIME Part. If toplevel - * is set to TRUE, then the MIME Part header will contain needed MIME - * headers for rfc822 messages. + * Returns an allocated string containing the MIME Part. **/ char * -g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel) +g_mime_part_to_string (GMimePart *mime_part) { GMimeStream *stream; GByteArray *buf; @@ -1219,7 +1201,7 @@ g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel) buf = g_byte_array_new (); stream = g_mime_stream_mem_new (); g_mime_stream_mem_set_byte_array (GMIME_STREAM_MEM (stream), buf); - g_mime_part_write_to_stream (mime_part, toplevel, stream); + g_mime_part_write_to_stream (mime_part, stream); g_mime_stream_unref (stream); g_byte_array_append (buf, "", 1); str = buf->data; diff --git a/gmime-part.h b/gmime-part.h index f24a894f..776078cc 100644 --- a/gmime-part.h +++ b/gmime-part.h @@ -123,8 +123,8 @@ void g_mime_part_add_subpart (GMimePart *mime_part, GMimePart *subpart); #define g_mime_part_add_child(mime_part, child) g_mime_part_add_subpart (mime_part, child) /* utility functions */ -void g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStream *stream); -char *g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel); +void g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream); +char *g_mime_part_to_string (GMimePart *mime_part); void g_mime_part_foreach (GMimePart *mime_part, GMimePartFunc callback, gpointer data); diff --git a/gmime/gmime-message.c b/gmime/gmime-message.c index acab2c80..78d4975b 100644 --- a/gmime/gmime-message.c +++ b/gmime/gmime-message.c @@ -539,9 +539,10 @@ g_mime_message_write_to_stream (GMimeMessage *message, GMimeStream *stream) g_mime_header_write_to_stream (message->header->headers, stream); - if (message->mime_part) - g_mime_part_write_to_stream (message->mime_part, TRUE, stream); - else + if (message->mime_part) { + g_mime_stream_write_string (stream, "MIME-Version: 1.0\n"); + g_mime_part_write_to_stream (message->mime_part, stream); + } else g_mime_stream_write (stream, "\n", 1); } diff --git a/gmime/gmime-part.c b/gmime/gmime-part.c index f80e92bc..f4bde8b0 100644 --- a/gmime/gmime-part.c +++ b/gmime/gmime-part.c @@ -1073,15 +1073,12 @@ write_content (GMimePart *part, GMimeStream *stream) /** * g_mime_part_write_to_stream: Write the MIME Part to a string * @mime_part: MIME Part - * @toplevel: mime part is the root mime part * @stream: output stream * - * Writes the contents of the MIME Part to @stream. If toplevel is set - * to TRUE, then the MIME Part header will contain needed MIME headers - * for rfc822 messages. + * Writes the contents of the MIME Part to @stream. **/ void -g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStream *stream) +g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream) { g_return_if_fail (mime_part != NULL); g_return_if_fail (stream != NULL); @@ -1099,22 +1096,13 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea } content_type = get_content_type (mime_part->mime_type); - - if (toplevel) { - g_mime_stream_printf (stream, "MIME-Version: 1.0\n" - "%s\n" /* content-type */ - "This is a multi-part message in MIME format.\n\n", - content_type); - } else { - g_mime_stream_printf (stream, "%s\n", content_type); - } - + g_mime_stream_printf (stream, "%s\n", content_type); g_free (content_type); child = mime_part->children; while (child) { g_mime_stream_printf (stream, "--%s\n", boundary); - g_mime_part_write_to_stream (child->data, FALSE, stream); + g_mime_part_write_to_stream (child->data, stream); g_mime_stream_write (stream, "\n", 1); child = child->next; @@ -1130,9 +1118,6 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea char *content_location; char *text; - if (toplevel) - g_mime_stream_write_string (stream, "MIME-Version: 1.0\n"); - /* Content-Type: */ content_type = get_content_type (mime_part->mime_type); g_mime_stream_write_string (stream, content_type); @@ -1201,14 +1186,11 @@ g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStrea /** * g_mime_part_to_string: Write the MIME Part to a string * @mime_part: MIME Part - * @toplevel: mime part is the root mime part * - * Returns an allocated string containing the MIME Part. If toplevel - * is set to TRUE, then the MIME Part header will contain needed MIME - * headers for rfc822 messages. + * Returns an allocated string containing the MIME Part. **/ char * -g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel) +g_mime_part_to_string (GMimePart *mime_part) { GMimeStream *stream; GByteArray *buf; @@ -1219,7 +1201,7 @@ g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel) buf = g_byte_array_new (); stream = g_mime_stream_mem_new (); g_mime_stream_mem_set_byte_array (GMIME_STREAM_MEM (stream), buf); - g_mime_part_write_to_stream (mime_part, toplevel, stream); + g_mime_part_write_to_stream (mime_part, stream); g_mime_stream_unref (stream); g_byte_array_append (buf, "", 1); str = buf->data; diff --git a/gmime/gmime-part.h b/gmime/gmime-part.h index f24a894f..776078cc 100644 --- a/gmime/gmime-part.h +++ b/gmime/gmime-part.h @@ -123,8 +123,8 @@ void g_mime_part_add_subpart (GMimePart *mime_part, GMimePart *subpart); #define g_mime_part_add_child(mime_part, child) g_mime_part_add_subpart (mime_part, child) /* utility functions */ -void g_mime_part_write_to_stream (GMimePart *mime_part, gboolean toplevel, GMimeStream *stream); -char *g_mime_part_to_string (GMimePart *mime_part, gboolean toplevel); +void g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream); +char *g_mime_part_to_string (GMimePart *mime_part); void g_mime_part_foreach (GMimePart *mime_part, GMimePartFunc callback, gpointer data); |