mu: add mu_msg_iter_is_(first|last)

This makes it a bit easier to process the output.
This commit is contained in:
djcb
2018-11-11 12:11:06 +02:00
parent 700e5e76da
commit 2aa299b3ac
2 changed files with 36 additions and 18 deletions

View File

@ -83,6 +83,24 @@ MuMsgIter *mu_msg_iter_new (XapianEnquire *enq,
*/
gboolean mu_msg_iter_next (MuMsgIter *iter);
/**
* Does this iterator point to the first item?
*
* @param iter a valid MuMsgIter iterator
*
* @return TRUE or FALSE
*/
gboolean mu_msg_iter_is_first (MuMsgIter *iter);
/**
* Does this iterator point to the last item?
*
* @param iter a valid MuMsgIter iterator
*
* @return TRUE or FALSE
*/
gboolean mu_msg_iter_is_last (MuMsgIter *iter);
/**
* reset the iterator to the beginning
@ -124,8 +142,6 @@ void mu_msg_iter_destroy (MuMsgIter *iter);
MuMsg* mu_msg_iter_get_msg_floating (MuMsgIter *iter)
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
/**
* Provide a preferred_hash, which is a hashtable msgid->docid to
* indicate the messages which should /not/ be seen as duplicates.
@ -136,8 +152,6 @@ MuMsg* mu_msg_iter_get_msg_floating (MuMsgIter *iter)
*/
void mu_msg_iter_set_preferred (MuMsgIter *iter, GHashTable *preferred_hash);
/**
* get the document id for the current message
*
@ -190,8 +204,6 @@ typedef struct _MuMsgIterThreadInfo MuMsgIterThreadInfo;
*/
const MuMsgIterThreadInfo* mu_msg_iter_get_thread_info (MuMsgIter *iter);
/**
* get the message-id for this message
*