X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fnotmuch.h;h=0ed4db5f641d7885db36f3f85bc16c86fba6c0f7;hp=0c306bb5ee2fd11e1ef576db367c6d97e2583c11;hb=7a8046ced8c0e61ddd0ff463cfc17ed63e6edad3;hpb=957f1ba3fc1d737887029ff1787fc6bea94de00b diff --git a/lib/notmuch.h b/lib/notmuch.h index 0c306bb5..0ed4db5f 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -81,6 +81,9 @@ typedef int notmuch_bool_t; * NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: The notmuch_message_thaw * function has been called more times than notmuch_message_freeze. * + * NOTMUCH_STATUS_UNBALANCED_ATOMIC: notmuch_database_end_atomic has + * been called more times than notmuch_database_begin_atomic. + * * And finally: * * NOTMUCH_STATUS_LAST_STATUS: Not an actual status value. Just a way @@ -97,6 +100,7 @@ typedef enum _notmuch_status { NOTMUCH_STATUS_NULL_POINTER, NOTMUCH_STATUS_TAG_TOO_LONG, NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW, + NOTMUCH_STATUS_UNBALANCED_ATOMIC, NOTMUCH_STATUS_LAST_STATUS } notmuch_status_t; @@ -222,6 +226,9 @@ notmuch_database_upgrade (notmuch_database_t *database, * only ensures atomicity, not durability; neither begin nor end * necessarily flush modifications to disk. * + * Atomic sections may be nested. begin_atomic and end_atomic must + * always be called in pairs. + * * Return value: * * NOTMUCH_STATUS_SUCCESS: Successfully entered atomic section. @@ -240,6 +247,9 @@ notmuch_database_begin_atomic (notmuch_database_t *notmuch); * * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred; * atomic section not ended. + * + * NOTMUCH_STATUS_UNBALANCED_ATOMIC: The database is not currently in + * an atomic section. */ notmuch_status_t notmuch_database_end_atomic (notmuch_database_t *notmuch); @@ -346,6 +356,22 @@ notmuch_message_t * notmuch_database_find_message (notmuch_database_t *database, const char *message_id); +/* Find a message with the given filename. + * + * If the database contains a message with the given filename, then a + * new notmuch_message_t object is returned. The caller should call + * notmuch_message_destroy when done with the message. + * + * This function returns NULL in the following situations: + * + * * No message is found with the given filename + * * An out-of-memory situation occurs + * * A Xapian exception occurs + */ +notmuch_message_t * +notmuch_database_find_message_by_filename (notmuch_database_t *notmuch, + const char *filename); + /* Return a list of all tags found in the database. * * This function creates a list of all tags found in the database. The