aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch-private.h
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-01-09 11:13:12 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-01-09 11:13:12 -0800
commitd12801c8b4d04a50fcb912b75017244fb09658e8 (patch)
tree8212267ab21f5e3f9fe274eaf53b58409445ada2 /lib/notmuch-private.h
parent5fe5e802ab3101a375ec1262770955904e169e47 (diff)
lib: Split the database upgrade into two phases for safer operation.
The first phase copies data from the old format to the new format without deleting anything. This allows an old notmuch to still use the database if the upgrade process gets interrupted. The second phase performs the deletion (after updating the database version number). If the second phase is interrupted, there will be some unused data in the database, but it shouldn't cause any actual harm.
Diffstat (limited to 'lib/notmuch-private.h')
-rw-r--r--lib/notmuch-private.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index f9adea72..c7fb0ef8 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -258,6 +258,22 @@ _notmuch_message_sync (notmuch_message_t *message);
void
_notmuch_message_close (notmuch_message_t *message);
+/* Get a copy of the data in this message document.
+ *
+ * Caller should talloc_free the result when done.
+ *
+ * This function is intended to support database upgrade and really
+ * shouldn't be used otherwise. */
+char *
+_notmuch_message_talloc_copy_data (notmuch_message_t *message);
+
+/* Clear the data in this message document.
+ *
+ * This function is intended to support database upgrade and really
+ * shouldn't be used otherwise. */
+void
+_notmuch_message_clear_data (notmuch_message_t *message);
+
/* index.cc */
notmuch_status_t