From 4e5d2f22db290a830c0267f34b519c6138af00ed Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 9 Mar 2010 09:22:29 -0800 Subject: lib: Rename iterator functions to prepare for reverse iteration. We rename 'has_more' to 'valid' so that it can function whether iterating in a forward or reverse direction. We also rename 'advance' to 'move_to_next' to setup parallel naming with the proposed functions 'move_to_first', 'move_to_last', and 'move_to_previous'. --- lib/messages.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/messages.c') diff --git a/lib/messages.c b/lib/messages.c index aa92535f..db2b7a16 100644 --- a/lib/messages.c +++ b/lib/messages.c @@ -102,13 +102,13 @@ _notmuch_messages_create (notmuch_message_list_t *list) * anyway. *sigh* */ notmuch_bool_t -notmuch_messages_has_more (notmuch_messages_t *messages) +notmuch_messages_valid (notmuch_messages_t *messages) { if (messages == NULL) return FALSE; if (! messages->is_of_list_type) - return _notmuch_mset_messages_has_more (messages); + return _notmuch_mset_messages_valid (messages); return (messages->iterator != NULL); } @@ -126,10 +126,10 @@ notmuch_messages_get (notmuch_messages_t *messages) } void -notmuch_messages_advance (notmuch_messages_t *messages) +notmuch_messages_move_to_next (notmuch_messages_t *messages) { if (! messages->is_of_list_type) - return _notmuch_mset_messages_advance (messages); + return _notmuch_mset_messages_move_to_next (messages); if (messages->iterator == NULL) return; @@ -162,11 +162,11 @@ notmuch_messages_collect_tags (notmuch_messages_t *messages) msg_tags = notmuch_message_get_tags (msg); while ((tag = notmuch_tags_get (msg_tags))) { g_hash_table_insert (htable, xstrdup (tag), NULL); - notmuch_tags_advance (msg_tags); + notmuch_tags_move_to_next (msg_tags); } notmuch_tags_destroy (msg_tags); notmuch_message_destroy (msg); - notmuch_messages_advance (messages); + notmuch_messages_move_to_next (messages); } keys = g_hash_table_get_keys (htable); -- cgit v1.2.3