aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2014-04-16 22:59:16 +1000
committerGravatar David Bremner <david@tethera.net>2014-07-09 20:29:36 -0300
commitab24e883b008b3fe2e211d87c6c88ec2aa01bdc0 (patch)
tree2597ec62311fd5010b917f95707180911ca41c28 /lib/notmuch.h
parent6721222ea8e3e8c0de15c5ae6f3ae0e388676c2a (diff)
lib: add return status to database close and destroy
notmuch_database_close may fail in Xapian ->flush() or ->close(), so report the status. Similarly for notmuch_database_destroy which calls close. This is required for notmuch insert to report error status if message indexing failed.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 350bed8b..3c5ec988 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -287,8 +287,16 @@ notmuch_database_open (const char *path,
*
* notmuch_database_close can be called multiple times. Later calls
* have no effect.
+ *
+ * Return value:
+ *
+ * NOTMUCH_STATUS_SUCCESS: Successfully closed the database.
+ *
+ * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred; the
+ * database has been closed but there are no guarantees the
+ * changes to the database, if any, have been flushed to disk.
*/
-void
+notmuch_status_t
notmuch_database_close (notmuch_database_t *database);
/**
@@ -317,8 +325,11 @@ notmuch_database_compact (const char* path,
/**
* Destroy the notmuch database, closing it if necessary and freeing
* all associated resources.
+ *
+ * Return value as in notmuch_database_close if the database was open;
+ * notmuch_database_destroy itself has no failure modes.
*/
-void
+notmuch_status_t
notmuch_database_destroy (notmuch_database_t *database);
/**