diff options
author | Austin Clements <amdragon@mit.edu> | 2011-06-11 00:19:31 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2011-09-24 20:00:28 -0300 |
commit | 7a8046ced8c0e61ddd0ff463cfc17ed63e6edad3 (patch) | |
tree | 93142e88c7122fa200917290349c691028e9e198 /lib/notmuch.h | |
parent | 59d2457bcc5e19f287006cea8da0c7c7a003200d (diff) |
lib: Add an API to find a message by filename.
notmuch_database_find_message_by_filename is mostly stolen from
notmuch_database_remove_message, so this patch also vastly simplfies
the latter using the former.
This API is also useful in its own right and will be used in a later
patch for eager maildir flag synchronization.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r-- | lib/notmuch.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h index bfa2ced8..0ed4db5f 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -356,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 |