+bool
+_notmuch_messages_has_next (notmuch_messages_t *messages)
+{
+ if (! notmuch_messages_valid (messages))
+ return false;
+
+ if (! messages->is_of_list_type)
+ INTERNAL_ERROR ("_notmuch_messages_has_next not implemented for msets");
+
+ return (messages->iterator->next != NULL);
+}
+