diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-06-19 04:32:18 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-06-19 04:32:18 +0800 |
commit | 19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767 (patch) | |
tree | 04f063fc3c18e43eea5251943be93fa89cfd5549 /camel/camel-mime-message.c | |
parent | 499ae51b86891889ffb5fd9954b1f60efcadfed2 (diff) | |
download | gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.gz gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.tar.zst gsoc2013-evolution-19a118096fe6f3d7b79a0fe3cb6e5bfe50ef8767.zip |
Commit of all Netherlands changes.
All mime stuff uses streams now, and it still works.
Bertrand
svn path=/trunk/; revision=981
Diffstat (limited to 'camel/camel-mime-message.c')
-rw-r--r-- | camel/camel-mime-message.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c index b0768d1aa7..dd984fbeac 100644 --- a/camel/camel-mime-message.c +++ b/camel/camel-mime-message.c @@ -70,7 +70,7 @@ static gboolean _get_flag (CamelMimeMessage *mime_message, GString *flag); static void _set_message_number (CamelMimeMessage *mime_message, guint number); static guint _get_message_number (CamelMimeMessage *mime_message); -static void _write_to_file(CamelDataWrapper *data_wrapper, FILE *file); +static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream); static gboolean _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *header_value); /* Returns the class for a CamelMimeMessage */ @@ -125,7 +125,7 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class) camel_mime_message_class->get_message_number = _get_message_number; /* virtual method overload */ - camel_data_wrapper_class->write_to_file = _write_to_file; + camel_data_wrapper_class->write_to_stream = _write_to_stream; camel_mime_part_class->parse_header_pair = _parse_header_pair; } @@ -514,39 +514,44 @@ camel_mime_message_get_message_number (CamelMimeMessage *mime_message) -#ifdef WHPTF -#warning : WHPTF is already defined !!!!!! +#ifdef WHPT +#warning : WHPT is already defined !!!!!! #endif -#define WHPTF gmime_write_header_pair_to_file +#define WHPT gmime_write_header_pair_to_stream static void -_write_one_recipient_to_file (gpointer key, gpointer value, gpointer user_data) +_write_one_recipient_to_stream (gpointer key, gpointer value, gpointer user_data) { GString *recipient_type = (GString *)key; GList *recipients = (GList *)value; // GString *current; - FILE *file = (FILE *)user_data; + CamelStream *stream = (CamelStream *)user_data; if ( (recipient_type) && (recipient_type->str) ) - write_header_with_glist_to_file (file, recipient_type->str, recipients); + write_header_with_glist_to_stream (stream, recipient_type->str, recipients); } static void -_write_recipients_to_file (CamelMimeMessage *mime_message, FILE *file) +_write_recipients_to_stream (CamelMimeMessage *mime_message, CamelStream *stream) { - g_hash_table_foreach (mime_message->recipients, _write_one_recipient_to_file, (gpointer)file); + g_hash_table_foreach (mime_message->recipients, _write_one_recipient_to_stream, (gpointer)stream); } static void -_write_to_file (CamelDataWrapper *data_wrapper, FILE *file) +_write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) { CamelMimeMessage *mm = CAMEL_MIME_MESSAGE (data_wrapper); - - WHPTF (file, "From", mm->from); - WHPTF (file, "Reply-To", mm->reply_to); - _write_recipients_to_file (mm, file); - WHPTF (file, "Date", mm->received_date); - WHPTF (file, "Subject", mm->subject); - CAMEL_DATA_WRAPPER_CLASS (parent_class)->write_to_file (data_wrapper, file); + CAMEL_LOG (FULL_DEBUG, "CamelMimeMessage::write_to_stream\n"); + CAMEL_LOG (FULL_DEBUG, "Writing \"From\"\n"); + WHPT (stream, "From", mm->from); + CAMEL_LOG (FULL_DEBUG, "Writing \"Reply-To\"\n"); + WHPT (stream, "Reply-To", mm->reply_to); + CAMEL_LOG (FULL_DEBUG, "Writing recipients\n"); + _write_recipients_to_stream (mm, stream); + CAMEL_LOG (FULL_DEBUG, "Writing \"Date\"\n"); + WHPT (stream, "Date", mm->received_date); + CAMEL_LOG (FULL_DEBUG, "Writing \"Subject\"\n"); + WHPT (stream, "Subject", mm->subject); + CAMEL_DATA_WRAPPER_CLASS (parent_class)->write_to_stream (data_wrapper, stream); } |