aboutsummaryrefslogtreecommitdiff
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorAustin Clements <aclements@csail.mit.edu>2014-10-13 02:20:02 -0400
committerDavid Bremner <david@tethera.net>2015-08-13 23:52:51 +0200
commit98ee460eaa98f1428aecf03dd39fcf314e6f62c0 (patch)
tree60fc701a61c88ea92bd009f0f662c8107360f56b /lib/notmuch.h
parent7f57b747b95eece465d10fd0acba20cc3dd868f1 (diff)
lib: API to retrieve database revision and UUID
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced).
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index b1f5bfa1..8639b383 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -468,6 +468,24 @@ notmuch_status_t
notmuch_database_end_atomic (notmuch_database_t *notmuch);
/**
+ * Return the committed database revision and UUID.
+ *
+ * The database revision number increases monotonically with each
+ * commit to the database. Hence, all messages and message changes
+ * committed to the database (that is, visible to readers) have a last
+ * modification revision <= the committed database revision. Any
+ * messages committed in the future will be assigned a modification
+ * revision > the committed database revision.
+ *
+ * The UUID is a NUL-terminated opaque string that uniquely identifies
+ * this database. Two revision numbers are only comparable if they
+ * have the same database UUID.
+ */
+unsigned long
+notmuch_database_get_revision (notmuch_database_t *notmuch,
+ const char **uuid);
+
+/**
* Retrieve a directory object from the database for 'path'.
*
* Here, 'path' should be a path relative to the path of 'database'