* (not necessarily by this process), by calling
* notmuch_database_create with 'path'. By default the database should be
* opened for reading only. In order to write to the database you need to
- * pass the NOTMUCH_DATABASE_MODE_WRITABLE mode.
+ * pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
*
* An existing notmuch database can be identified by the presence of a
* directory named ".notmuch" below 'path'.
* Here, 'path' should be a path relative to the path of 'database'
* (see notmuch_database_get_path), or else should be an absolute path
* with initial components that match the path of 'database'.
+ *
+ * Can return NULL if a Xapian exception occurs.
*/
notmuch_directory_t *
notmuch_database_get_directory (notmuch_database_t *database,
*
* NOTMUCH_STATUS_SUCCESS: Message successfully added to database.
*
+ * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
+ * message not added.
+ *
* NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message
* ID as another message already in the database. The new
* filename was successfully added to the message in the database
* NOTMUCH_STATUS_SUCCESS: The last filename was removed and the
* message was removed from the database.
*
+ * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
+ * message not removed.
+ *
* NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
* the message persists in the database with at least one other
* filename.
* a new notmuch_message_t object is returned. The caller should call
* notmuch_message_destroy when done with the message.
*
- * If no message is found with the given message_id or if an
- * out-of-memory situation occurs, this function returns NULL.
+ * This function returns NULL in the following situations:
+ *
+ * * No message is found with the given message_id
+ * * An out-of-memory situation occurs
+ * * A Xapian exception occurs
*/
notmuch_message_t *
notmuch_database_find_message (notmuch_database_t *database,
typedef enum {
NOTMUCH_SORT_OLDEST_FIRST,
NOTMUCH_SORT_NEWEST_FIRST,
- NOTMUCH_SORT_MESSAGE_ID
+ NOTMUCH_SORT_MESSAGE_ID,
+ NOTMUCH_SORT_UNSORTED
} notmuch_sort_t;
/* Specify the sorting desired for this query. */
* notmuch_messages_t object. (For consistency, we do provide a
* notmuch_messages_destroy function, but there's no good
* reason to call it if the query is about to be destroyed).
+ *
+ * If a Xapian exception occurs this function will return NULL.
*/
notmuch_messages_t *
notmuch_query_search_messages (notmuch_query_t *query);
*
* This function performs a search and returns Xapian's best
* guess as to number of matching messages.
+ *
+ * If a Xapian exception occurs, this function may return 0 (after
+ * printing a message).
*/
unsigned
notmuch_query_count_messages (notmuch_query_t *query);