aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/query.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-03-09 09:22:29 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-03-09 09:22:29 -0800
commit4e5d2f22db290a830c0267f34b519c6138af00ed (patch)
treeb75346865280153187774efb4cf38562fe912bfc /lib/query.cc
parentc5085642b8c6495ffea3d5709aa6da14cd1d8688 (diff)
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'.
Diffstat (limited to 'lib/query.cc')
-rw-r--r--lib/query.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/query.cc b/lib/query.cc
index 2c8d1672..9266d35f 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -170,7 +170,7 @@ notmuch_query_search_messages (notmuch_query_t *query)
}
notmuch_bool_t
-_notmuch_mset_messages_has_more (notmuch_messages_t *messages)
+_notmuch_mset_messages_valid (notmuch_messages_t *messages)
{
notmuch_mset_messages_t *mset_messages;
@@ -189,7 +189,7 @@ _notmuch_mset_messages_get (notmuch_messages_t *messages)
mset_messages = (notmuch_mset_messages_t *) messages;
- if (! _notmuch_mset_messages_has_more (&mset_messages->base))
+ if (! _notmuch_mset_messages_valid (&mset_messages->base))
return NULL;
doc_id = *mset_messages->iterator;
@@ -208,7 +208,7 @@ _notmuch_mset_messages_get (notmuch_messages_t *messages)
}
void
-_notmuch_mset_messages_advance (notmuch_messages_t *messages)
+_notmuch_mset_messages_move_to_next (notmuch_messages_t *messages)
{
notmuch_mset_messages_t *mset_messages;
@@ -258,14 +258,14 @@ notmuch_query_destroy (notmuch_query_t *query)
}
notmuch_bool_t
-notmuch_threads_has_more (notmuch_threads_t *threads)
+notmuch_threads_valid (notmuch_threads_t *threads)
{
notmuch_message_t *message;
if (threads->thread_id)
return TRUE;
- while (notmuch_messages_has_more (threads->messages))
+ while (notmuch_messages_valid (threads->messages))
{
message = notmuch_messages_get (threads->messages);
@@ -277,11 +277,11 @@ notmuch_threads_has_more (notmuch_threads_t *threads)
{
g_hash_table_insert (threads->threads,
xstrdup (threads->thread_id), NULL);
- notmuch_messages_advance (threads->messages);
+ notmuch_messages_move_to_next (threads->messages);
return TRUE;
}
- notmuch_messages_advance (threads->messages);
+ notmuch_messages_move_to_next (threads->messages);
}
threads->thread_id = NULL;
@@ -291,7 +291,7 @@ notmuch_threads_has_more (notmuch_threads_t *threads)
notmuch_thread_t *
notmuch_threads_get (notmuch_threads_t *threads)
{
- if (! notmuch_threads_has_more (threads))
+ if (! notmuch_threads_valid (threads))
return NULL;
return _notmuch_thread_create (threads->query,
@@ -301,7 +301,7 @@ notmuch_threads_get (notmuch_threads_t *threads)
}
void
-notmuch_threads_advance (notmuch_threads_t *threads)
+notmuch_threads_move_to_next (notmuch_threads_t *threads)
{
threads->thread_id = NULL;
}