evolution-data-server r8871 - branches/camel-db-summary/camel/providers/local
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r8871 - branches/camel-db-summary/camel/providers/local
- Date: Thu, 29 May 2008 09:37:16 +0000 (UTC)
Author: sragavan
Date: Thu May 29 09:37:16 2008
New Revision: 8871
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8871&view=rev
Log:
Implement local summary stuff.
Modified:
branches/camel-db-summary/camel/providers/local/camel-local-summary.c
Modified: branches/camel-db-summary/camel/providers/local/camel-local-summary.c
==============================================================================
--- branches/camel-db-summary/camel/providers/local/camel-local-summary.c (original)
+++ branches/camel-db-summary/camel/providers/local/camel-local-summary.c Thu May 29 09:37:16 2008
@@ -46,6 +46,11 @@
#define CAMEL_LOCAL_SUMMARY_VERSION (1)
+#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
+
+static CamelFIRecord * summary_header_to_db (CamelFolderSummary *);
+static int summary_header_from_db (CamelFolderSummary *, CamelFIRecord *);
+
static int summary_header_load (CamelFolderSummary *, FILE *);
static int summary_header_save (CamelFolderSummary *, FILE *);
@@ -91,7 +96,10 @@
sklass->summary_header_load = summary_header_load;
sklass->summary_header_save = summary_header_save;
-
+
+ sklass->summary_header_from_db = summary_header_from_db;
+ sklass->summary_header_to_db = summary_header_to_db;
+
sklass->message_info_new_from_header = message_info_new_from_header;
klass->load = local_summary_load;
@@ -585,6 +593,28 @@
return 0;
}
+
+static int
+summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *fir)
+{
+ CamelLocalSummary *cls = (CamelLocalSummary *)s;
+ char *part;
+
+ /* We dont actually add our own headers, but version that we don't anyway */
+
+ if (((CamelFolderSummaryClass *)camel_local_summary_parent)->summary_header_from_db(s, fir) == -1)
+ return -1;
+
+ part = fir->bdata;
+ if (part) {
+ EXTRACT_FIRST_DIGIT (cls->version)
+ }
+ fir->bdata = part;
+
+ return 0;
+}
+
+
static int
summary_header_load(CamelFolderSummary *s, FILE *in)
{
@@ -603,6 +633,17 @@
return camel_file_util_decode_fixed_int32(in, &cls->version);
}
+static struct _CamelFIRecord *
+summary_header_to_db (CamelFolderSummary *s)
+{
+ struct _CamelFIRecord *fir;
+
+ fir = ((CamelFolderSummaryClass *)camel_local_summary_parent)->summary_header_to_db (s);
+ fir->bdata = g_strdup_printf ("%lu", CAMEL_LOCAL_SUMMARY_VERSION);
+
+ return fir;
+}
+
static int
summary_header_save(CamelFolderSummary *s, FILE *out)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]