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,
* object is owned by the query and as such, will only be valid until
* notmuch_query_destroy.
*
- * The 'first' and 'max_threads' arguments can be used to obtain
- * partial results from the search. For example, to get results 10 at
- * a time, pass 'max_threads' as 10 and for 'first' pass the values 0,
- * 10, 20, etc. As a special case, a value of -1 for 'max_threads'
- * indicates that no limiting is to be performed. So a search with
- * 'first' == 0 and 'max_threads' == -1 will return the complete
- * results of the search.
- *
* Typical usage might be:
*
* notmuch_query_t *query;
* to call it if the query is about to be destroyed).
*/
notmuch_threads_t *
-notmuch_query_search_threads (notmuch_query_t *query,
- int first, int max_threads);
+notmuch_query_search_threads (notmuch_query_t *query);
/* Execute a query for messages, returning a notmuch_messages_t object
* which can be used to iterate over the results. The returned
* messages object is owned by the query and as such, will only be
* valid until notmuch_query_destroy.
*
- * The 'first' and 'max_messages' arguments can be used to obtain
- * partial results from the search. For example, to get results 10 at
- * a time, pass 'max_messages' as 10 and for 'first' pass the values
- * 0, 10, 20, etc. As a special case, a value of -1 for 'max_messages'
- * indicates that no limiting is to be performed. So a search with
- * 'first' == 0 and 'max_messages' == -1 will return the complete
- * results of the search.
- *
* Typical usage might be:
*
* notmuch_query_t *query;
* reason to call it if the query is about to be destroyed).
*/
notmuch_messages_t *
-notmuch_query_search_messages (notmuch_query_t *query,
- int first, int max_messages);
+notmuch_query_search_messages (notmuch_query_t *query);
/* Destroy a notmuch_query_t along with any associated resources.
*
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
const char *
notmuch_message_get_filename (notmuch_message_t *message);
+/* Message flags */
+typedef enum _notmuch_message_flag {
+ NOTMUCH_MSG_FLAG_MATCHING_SEARCH,
+} notmuch_message_flag_t;
+
+/* Get a value of a flag for the email corresponding to 'message'. */
+notmuch_bool_t
+notmuch_message_get_flag (notmuch_message_t *message,
+ notmuch_message_flag_t flag);
+
+/* Set a value of a flag for the email corresponding to 'message'. */
+void
+notmuch_message_set_flag (notmuch_message_t *message,
+ notmuch_message_flag_t flag, notmuch_bool_t value);
+
/* Get the date of 'message' as a time_t value.
*
* For the original textual representation of the Date header from the