diff options
author | bertrand <bertrand@helixcode.com> | 2000-01-19 03:29:48 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-01-19 03:29:48 +0800 |
commit | 5e4695e7178c12d47fb5f758e203256cabbc3823 (patch) | |
tree | 30e5e311d14e651981aa5d9d178bb7c1e64676c1 /camel/providers/mbox/camel-mbox-utils.c | |
parent | 64046a6665df493b03a057c7e66f4d84c4b4ba21 (diff) | |
download | gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar.gz gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar.bz2 gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar.lz gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar.xz gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.tar.zst gsoc2013-evolution-5e4695e7178c12d47fb5f758e203256cabbc3823.zip |
summary file read/write routines.
2000-01-18 bertrand <bertrand@helixcode.com>
* camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
(mbox_load_summary): summary file read/write routines.
* camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
routine to construct the summary after the mbox
file has been parsed and the x-evolution fields
inserted.
* camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev):
dont use the x_evolution field but rather the uid to
determine the presence of "X-Evolution" in the mail.
* camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
parse the status and uid values if the x-evolution
has been found.
* camel/providers/mbox/camel-mbox-utils.c (camel_mbox_xev_parse_header_content):
return the parsed status field correctly.
* camel/providers/mbox/camel-mbox-utils.h:
fixed bad prototype.
* camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
parse and store the "To:" header.
* camel/providers/mbox/camel-mbox-parser.h:
added a "to" field
* camel/camel-folder-summary.c:
create the arrays here.
* camel/camel-folder-summary.h: the list of
summary information is no longer a GList but
rather a GArray.
Parsing/summary/sync-check is here. Needs testing
and integration with the rest of the folder code.
svn path=/trunk/; revision=1589
Diffstat (limited to 'camel/providers/mbox/camel-mbox-utils.c')
-rw-r--r-- | camel/providers/mbox/camel-mbox-utils.c | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/camel/providers/mbox/camel-mbox-utils.c b/camel/providers/mbox/camel-mbox-utils.c index f4cbe34899..d0b0db5518 100644 --- a/camel/providers/mbox/camel-mbox-utils.c +++ b/camel/providers/mbox/camel-mbox-utils.c @@ -57,6 +57,8 @@ #include <glib.h> #include "camel-mbox-utils.h" #include "camel-mbox-parser.h" +#include "camel-folder-summary.h" +#include "camel-mbox-summary.h" @@ -132,7 +134,7 @@ string_to_flag (gchar string) void camel_mbox_xev_parse_header_content (gchar header_content[6], guint32 *uid, - guchar status) + guchar *status) { /* we assume that the first 4 characters of the header content @@ -140,7 +142,7 @@ camel_mbox_xev_parse_header_content (gchar header_content[6], toooo bad. */ *uid = string_to_uid (header_content); - status = string_to_flag (header_content[5]); + *status = string_to_flag (header_content[5]); } void @@ -249,7 +251,7 @@ camel_mbox_write_xev (gchar *mbox_file_name, cur_msg_info = (CamelMboxParserMessageInfo *)(summary_information->data) + cur_msg; end_of_last_message = cur_msg_info->message_position + cur_msg_info->size; - if ( !cur_msg_info->x_evolution) { + if (cur_msg_info->uid == 0) { bytes_to_copy = cur_msg_info->message_position + cur_msg_info->end_of_headers_offset @@ -265,9 +267,10 @@ camel_mbox_write_xev (gchar *mbox_file_name, goto end; } - printf ("Writing the x-ev header\n"); - printf ("Current message number : %d\n", cur_msg); - camel_mbox_xev_write_header_content (xev_header + 12, next_free_uid++, 0); + cur_msg_info->uid = next_free_uid; + cur_msg_info->status = 0; + camel_mbox_xev_write_header_content (xev_header + 12, next_free_uid, 0); + next_free_uid++; write (fd2, xev_header, 19); cur_offset += 19; cur_msg_info->size += 19; @@ -333,5 +336,41 @@ camel_mbox_write_xev (gchar *mbox_file_name, +GArray * +parsed_information_to_mbox_summary (GArray *parsed_information) +{ + guint cur_msg; + CamelMboxParserMessageInfo *cur_msg_info; + GArray *mbox_summary; + CamelMboxSummaryInformation cur_sum_info; + + mbox_summary = g_array_new (FALSE, FALSE, sizeof (CamelMboxSummaryInformation)); + mbox_summary = g_array_set_size (mbox_summary, parsed_information->len); + + for (cur_msg = 0; cur_msg < parsed_information->len; cur_msg++) { + + cur_msg_info = (CamelMboxParserMessageInfo *)(parsed_information->data) + cur_msg; + + cur_sum_info.position = cur_msg_info->message_position; + + cur_sum_info.x_evolution_offset = cur_msg_info->x_evolution_offset; + + cur_sum_info.uid = cur_msg_info->uid; + + cur_sum_info.status = cur_msg_info->status; + cur_sum_info.subject = cur_msg_info->subject; + cur_msg_info->subject = NULL; + cur_sum_info.sender = cur_msg_info->from; + cur_msg_info->from = NULL; + + cur_sum_info.to = cur_msg_info->to; + cur_msg_info->to = NULL; + + g_array_append_vals (mbox_summary, &cur_sum_info, 1); + + } + + return mbox_summary; +} |