X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fnotmuch.h;h=247f6ad71ebf1223b32f1c2b5e226261a309ffc1;hp=216b1c75354bed58d08228248adfc87ecd7b9445;hb=e49398dcada520c03ccd95d6b26900f5aa2d857e;hpb=4a6371f1d80aec5947b41d7c4e1fdb60cca3c55d diff --git a/lib/notmuch.h b/lib/notmuch.h index 216b1c75..247f6ad7 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -1351,7 +1351,7 @@ notmuch_messages_collect_tags (notmuch_messages_t *messages); * @since libnotmuch 5.2 (notmuch 0.27) */ notmuch_database_t * -notmuch_message_get_database (notmuch_message_t *message); +notmuch_message_get_database (const notmuch_message_t *message); /** * Get the message ID of 'message'. @@ -1890,6 +1890,22 @@ typedef struct _notmuch_string_map_iterator notmuch_message_properties_t; notmuch_message_properties_t * notmuch_message_get_properties (notmuch_message_t *message, const char *key, notmuch_bool_t exact); +/** + * Return the number of properties named "key" belonging to the specific message. + * + * @param[in] message The message to examine + * @param[in] key key to count + * @param[out] count The number of matching properties associated with this message. + * + * @returns + * + * NOTMUCH_STATUS_SUCCESS: successful count, possibly some other error. + * + * @since libnotmuch 5.2 (notmuch 0.27) + */ +notmuch_status_t +notmuch_message_count_properties (notmuch_message_t *message, const char *key, unsigned int *count); + /** * Is the given *properties* iterator pointing at a valid (key,value) * pair.