aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-11-11 00:07:24 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-11-11 03:40:19 -0800
commit1d02dd64afe245a2b5a8461feeba975e61f0c233 (patch)
tree53ac99ecf481c27709e2d0f26b9c7d8d6d246b02 /lib/notmuch.h
parentd87db8843266caf6b11c1f2f1874328830b23878 (diff)
lib: Add new, public notmuch_message_get_filenames
This augments the existing notmuch_message_get_filename by allowing the caller access to all filenames in the case of multiple files for a single message. To support this, we split the iterator (notmuch_filenames_t) away from the list storage (notmuch_filename_list_t) where previously these were a single object (notmuch_filenames_t). Then, whenever the user asks for a file or filename, the message object lazily creates a complete notmuch_filename_list_t and then: For notmuch_message_get_filename, returns the first filename in the list. For notmuch_message_get_filenames, creates and returns a new iterator for the filename list.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index b15f1249..413b5709 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -772,11 +772,24 @@ notmuch_message_get_replies (notmuch_message_t *message);
* Note: If this message corresponds to multiple files in the mail
* store, (that is, multiple files contain identical message IDs),
* this function will arbitrarily return a single one of those
- * filenames.
+ * filenames. See notmuch_message_get_filenames for returning the
+ * complete list of filenames.
*/
const char *
notmuch_message_get_filename (notmuch_message_t *message);
+/* Get all filenames for the email corresponding to 'message'.
+ *
+ * Returns a notmuch_filenames_t iterator listing all the filenames
+ * associated with 'message'. These files may not have identical
+ * content, but each will have the identical Message-ID.
+ *
+ * Each filename in the iterator is an absolute filename, (the initial
+ * component will match notmuch_database_get_path() ).
+ */
+notmuch_filenames_t *
+notmuch_message_get_filenames (notmuch_message_t *message);
+
/* Message flags */
typedef enum _notmuch_message_flag {
NOTMUCH_MESSAGE_FLAG_MATCH