* (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
* (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
*
* An existing notmuch database can be identified by the presence of a
* directory named ".notmuch" below 'path'.
*
* 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'.
* 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'.
* 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_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_SUCCESS: The last filename was removed and the
* message was removed from the database.
*
* NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
* the message persists in the database with at least one other
* filename.
* 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.
*
* 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
- * As a special case, passing a length-zero string, (that is ""), will
+ * As a special case, passing either a length-zero string, (that is ""),
+ * or a string consisting of a single asterisk (that is "*"), will
* result in a query that returns all messages in the database.
*
* See notmuch_query_set_sort for controlling the order of results.
* result in a query that returns all messages in the database.
*
* See notmuch_query_set_sort for controlling the order of results.
typedef enum {
NOTMUCH_SORT_OLDEST_FIRST,
NOTMUCH_SORT_NEWEST_FIRST,
typedef enum {
NOTMUCH_SORT_OLDEST_FIRST,
NOTMUCH_SORT_NEWEST_FIRST,
/* Specify the sorting desired for this query. */
void
notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
/* Specify the sorting desired for this query. */
void
notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
/* Execute a query for threads, returning a notmuch_threads_t object
* which can be used to iterate over the results. The returned threads
* object is owned by the query and as such, will only be valid until
/* Execute a query for threads, returning a notmuch_threads_t object
* which can be used to iterate over the results. The returned threads
* object is owned by the query and as such, will only be valid until
* notmuch_threads_t object. (For consistency, we do provide a
* notmuch_threads_destroy function, but there's no good reason
* to call it if the query is about to be destroyed).
* notmuch_threads_t object. (For consistency, we do provide a
* notmuch_threads_destroy function, but there's no good reason
* to call it if the query is about to be destroyed).
* 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).
* 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).
*
* This function performs a search and returns Xapian's best
* guess as to number of matching messages.
*
* This function performs a search and returns Xapian's best
* guess as to number of matching messages.