]> git.notmuchmail.org Git - notmuch/blobdiff - lib/notmuch.h
Add 'notmuch count' command to show the count of matching messages
[notmuch] / lib / notmuch.h
index 89ed7ad88b7eb91ead3d6cefe518f29b410cdfd2..260cc22d370088bf74ca3cee81d5b88dc19dbb4b 100644 (file)
@@ -137,14 +137,14 @@ typedef struct _notmuch_tags notmuch_tags_t;
 notmuch_database_t *
 notmuch_database_create (const char *path);
 
-/* XXX: I think I'd like this to take an extra argument of
- * notmuch_status_t* for returning a status value on failure. */
-
 typedef enum {
-    NOTMUCH_DATABASE_MODE_READONLY = 0,
-    NOTMUCH_DATABASE_MODE_WRITABLE
+    NOTMUCH_DATABASE_MODE_READ_ONLY = 0,
+    NOTMUCH_DATABASE_MODE_READ_WRITE
 } notmuch_database_mode_t;
 
+/* XXX: I think I'd like this to take an extra argument of
+ * notmuch_status_t* for returning a status value on failure. */
+
 /* Open an existing notmuch database located at 'path'.
  *
  * The database should have been created at some time in the past,
@@ -468,6 +468,14 @@ notmuch_threads_advance (notmuch_threads_t *threads);
 void
 notmuch_threads_destroy (notmuch_threads_t *threads);
 
+/* Return an estimate of the number of messages matching a search
+ *
+ * This function performs a search and returns Xapian's best
+ * guess as to number of matching messages.
+ */
+unsigned
+notmuch_query_count_messages (notmuch_query_t *query);
 /* Get the thread ID of 'thread'.
  *
  * The returned string belongs to 'thread' and as such, should not be