aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/mbox/camel-mbox-summary.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-01-23 09:45:49 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-01-23 09:45:49 +0800
commitfbcdf475521aaf13049ddc7c9f96bb0c9ed9b870 (patch)
treed88c2cb9c90118a12e441eb42c67c26ef4275b1a /camel/providers/mbox/camel-mbox-summary.c
parent15e6a36cefc4c87efd5314aab7e27ee10c4dbeb6 (diff)
downloadgsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar.gz
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar.bz2
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar.lz
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar.xz
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.tar.zst
gsoc2013-evolution-fbcdf475521aaf13049ddc7c9f96bb0c9ed9b870.zip
use the real summary file path instead of a stupid hardcoded one. Fixes
2000-01-22 bertrand <bertrand@helixcode.com> * camel/providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file): use the real summary file path instead of a stupid hardcoded one. Fixes yet another bug. * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary): don't forget to copy the date too. Fix a very annoying bug. * camel/providers/mbox/camel-mbox-folder.c (_append_message): implemented. A lot of fixes too. Works now. (_get_uid_list): implemented. svn path=/trunk/; revision=1609
Diffstat (limited to 'camel/providers/mbox/camel-mbox-summary.c')
-rw-r--r--camel/providers/mbox/camel-mbox-summary.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c
index f35ca16a16..2cbb481700 100644
--- a/camel/providers/mbox/camel-mbox-summary.c
+++ b/camel/providers/mbox/camel-mbox-summary.c
@@ -47,6 +47,7 @@ camel_mbox_save_summary (CamelMboxSummary *summary, const gchar *filename, Camel
guint cur_msg;
guint field_lgth;
gint fd;
+ gint write_result;
CAMEL_LOG_FULL_DEBUG ("CamelMboxFolder::save_summary entering \n");
@@ -67,8 +68,8 @@ camel_mbox_save_summary (CamelMboxSummary *summary, const gchar *filename, Camel
/* write the number of messages + the md5 signatures
+ next UID + mbox file size */
- write (fd, summary, sizeof (guint) + sizeof (guchar) * 16 + 2 * sizeof (guint32));
-
+ write_result = write (fd, summary, G_STRUCT_OFFSET (CamelMboxSummary, message_info));
+
for (cur_msg=0; cur_msg < summary->nb_message; cur_msg++) {
@@ -85,7 +86,6 @@ camel_mbox_save_summary (CamelMboxSummary *summary, const gchar *filename, Camel
write (fd, &field_lgth, sizeof (guint));
if (field_lgth)
write (fd, msg_info->subject, field_lgth);
-
/* write sender */
field_lgth = msg_info->sender ? strlen (msg_info->sender) : 0;
write (fd, &field_lgth, sizeof (gint));
@@ -124,7 +124,7 @@ camel_mbox_load_summary (const gchar *filename, CamelException *ex)
guint field_lgth;
gint fd;
CamelMboxSummary *summary;
-
+ gint read_result;
CAMEL_LOG_FULL_DEBUG ("CamelMboxFolder::save_summary entering \n");
@@ -143,7 +143,8 @@ camel_mbox_load_summary (const gchar *filename, CamelException *ex)
/* read the message number, the md5 signature
and the next available UID + mbox file size */
- read (fd, summary, sizeof (guint) + sizeof (guchar) * 16 + 2 * sizeof (guint32));
+ read_result = read (fd, summary, G_STRUCT_OFFSET (CamelMboxSummary, message_info));
+
summary->message_info = g_array_new (FALSE, FALSE, sizeof (CamelMboxSummaryInformation));
summary->message_info = g_array_set_size (summary->message_info, summary->nb_message);
@@ -249,3 +250,14 @@ camel_mbox_check_summary_sync (gchar *summary_filename,
return (strncmp (real_md5, summary_md5, 16) == 0);
}
+
+
+
+
+void
+camel_summary_append_entries (CamelMboxSummary *summary, GArray *entries)
+{
+
+ summary->message_info = g_array_append_vals (summary->message_info, entries->data, entries->len);
+
+}