From 4e5d2f22db290a830c0267f34b519c6138af00ed Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 9 Mar 2010 09:22:29 -0800 Subject: [PATCH] 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/database.cc | 8 +++--- lib/directory.cc | 4 +-- lib/message.cc | 4 +-- lib/messages.c | 12 ++++----- lib/notmuch-private.h | 4 +-- lib/notmuch.h | 57 ++++++++++++++++++++----------------------- lib/query.cc | 18 +++++++------- lib/tags.c | 7 +++--- lib/thread.cc | 12 ++++----- notmuch-dump.c | 8 +++--- notmuch-new.c | 28 ++++++++++----------- notmuch-reply.c | 8 +++--- notmuch-restore.c | 4 +-- notmuch-search-tags.c | 2 +- notmuch-search.c | 8 +++--- notmuch-show.c | 12 ++++----- notmuch-tag.c | 4 +-- 17 files changed, 99 insertions(+), 101 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 2b5b64df..88c85ed4 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -751,8 +751,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, total = notmuch_query_count_messages (query); for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { if (do_progress_notify) { progress_notify (closure, (double) count / total); @@ -827,8 +827,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, char *filename; for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { if (do_progress_notify) { progress_notify (closure, (double) count / total); diff --git a/lib/directory.cc b/lib/directory.cc index bb6314ad..5e75b73e 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -79,7 +79,7 @@ _notmuch_filenames_create (void *ctx, } notmuch_bool_t -notmuch_filenames_has_more (notmuch_filenames_t *filenames) +notmuch_filenames_valid (notmuch_filenames_t *filenames) { if (filenames == NULL) return NULL; @@ -105,7 +105,7 @@ notmuch_filenames_get (notmuch_filenames_t *filenames) } void -notmuch_filenames_advance (notmuch_filenames_t *filenames) +notmuch_filenames_move_to_next (notmuch_filenames_t *filenames) { if (filenames == NULL) return; diff --git a/lib/message.cc b/lib/message.cc index 01950505..0f98222d 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -739,8 +739,8 @@ notmuch_message_remove_all_tags (notmuch_message_t *message) return status; for (tags = notmuch_message_get_tags (message); - notmuch_tags_has_more (tags); - notmuch_tags_advance (tags)) + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { tag = notmuch_tags_get (tags); 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); diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index c7fb0ef8..d52d84d4 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -382,13 +382,13 @@ _notmuch_messages_create (notmuch_message_list_t *list); /* query.cc */ notmuch_bool_t -_notmuch_mset_messages_has_more (notmuch_messages_t *messages); +_notmuch_mset_messages_valid (notmuch_messages_t *messages); notmuch_message_t * _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); /* message.cc */ diff --git a/lib/notmuch.h b/lib/notmuch.h index d3e50a79..479a1dcd 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -364,8 +364,8 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort); * query = notmuch_query_create (database, query_string); * * for (threads = notmuch_query_search_threads (query); - * notmuch_threads_has_more (threads); - * notmuch_threads_advance (threads)) + * notmuch_threads_valid (threads); + * notmuch_threads_move_to_next (threads)) * { * thread = notmuch_threads_get (threads); * .... @@ -403,8 +403,8 @@ notmuch_query_search_threads (notmuch_query_t *query); * query = notmuch_query_create (database, query_string); * * for (messages = notmuch_query_search_messages (query); - * notmuch_messages_has_more (messages); - * notmuch_messages_advance (messages)) + * notmuch_messages_valid (messages); + * notmuch_messages_move_to_next (messages)) * { * message = notmuch_messages_get (messages); * .... @@ -439,18 +439,17 @@ notmuch_query_search_messages (notmuch_query_t *query); void notmuch_query_destroy (notmuch_query_t *query); -/* Does the given notmuch_threads_t object contain any more - * results. +/* Is the given 'threads' iterator pointing at a valid thread. * - * When this function returns TRUE, notmuch_threads_get will - * return a valid object. Whereas when this function returns FALSE, + * When this function returns TRUE, notmuch_threads_get will return a + * valid object. Whereas when this function returns FALSE, * notmuch_threads_get will return NULL. * * See the documentation of notmuch_query_search_threads for example * code showing how to iterate over a notmuch_threads_t object. */ notmuch_bool_t -notmuch_threads_has_more (notmuch_threads_t *threads); +notmuch_threads_valid (notmuch_threads_t *threads); /* Get the current thread from 'threads' as a notmuch_thread_t. * @@ -466,13 +465,13 @@ notmuch_threads_has_more (notmuch_threads_t *threads); notmuch_thread_t * notmuch_threads_get (notmuch_threads_t *threads); -/* Advance the 'threads' iterator to the next thread. +/* Move the 'threads' iterator to the next thread. * * See the documentation of notmuch_query_search_threads for example * code showing how to iterate over a notmuch_threads_t object. */ void -notmuch_threads_advance (notmuch_threads_t *threads); +notmuch_threads_move_to_next (notmuch_threads_t *threads); /* Destroy a notmuch_threads_t object. * @@ -593,8 +592,8 @@ notmuch_thread_get_newest_date (notmuch_thread_t *thread); * thread = notmuch_threads_get (threads); * * for (tags = notmuch_thread_get_tags (thread); - * notmuch_tags_has_more (tags); - * notmuch_result_advance (tags)) + * notmuch_tags_valid (tags); + * notmuch_result_move_to_next (tags)) * { * tag = notmuch_tags_get (tags); * .... @@ -614,8 +613,7 @@ notmuch_thread_get_tags (notmuch_thread_t *thread); void notmuch_thread_destroy (notmuch_thread_t *thread); -/* Does the given notmuch_messages_t object contain any more - * messages. +/* Is the given 'messages' iterator pointing at a valid message. * * When this function returns TRUE, notmuch_messages_get will return a * valid object. Whereas when this function returns FALSE, @@ -625,7 +623,7 @@ notmuch_thread_destroy (notmuch_thread_t *thread); * code showing how to iterate over a notmuch_messages_t object. */ notmuch_bool_t -notmuch_messages_has_more (notmuch_messages_t *messages); +notmuch_messages_valid (notmuch_messages_t *messages); /* Get the current message from 'messages' as a notmuch_message_t. * @@ -641,13 +639,13 @@ notmuch_messages_has_more (notmuch_messages_t *messages); notmuch_message_t * notmuch_messages_get (notmuch_messages_t *messages); -/* Advance the 'messages' iterator to the next result. +/* Move the 'messages' iterator to the next message. * * See the documentation of notmuch_query_search_messages for example * code showing how to iterate over a notmuch_messages_t object. */ void -notmuch_messages_advance (notmuch_messages_t *messages); +notmuch_messages_move_to_next (notmuch_messages_t *messages); /* Destroy a notmuch_messages_t object. * @@ -715,7 +713,7 @@ notmuch_message_get_thread_id (notmuch_message_t *message); * will return NULL. * * If there are no replies to 'message', this function will return - * NULL. (Note that notmuch_messages_has_more will accept that NULL + * NULL. (Note that notmuch_messages_valid will accept that NULL * value as legitimate, and simply return FALSE for it.) */ notmuch_messages_t * @@ -792,8 +790,8 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header); * message = notmuch_database_find_message (database, message_id); * * for (tags = notmuch_message_get_tags (message); - * notmuch_tags_has_more (tags); - * notmuch_result_advance (tags)) + * notmuch_tags_valid (tags); + * notmuch_result_move_to_next (tags)) * { * tag = notmuch_tags_get (tags); * .... @@ -934,7 +932,7 @@ notmuch_message_thaw (notmuch_message_t *message); void notmuch_message_destroy (notmuch_message_t *message); -/* Does the given notmuch_tags_t object contain any more tags. +/* Is the given 'tags' iterator pointing at a valid tag. * * When this function returns TRUE, notmuch_tags_get will return a * valid string. Whereas when this function returns FALSE, @@ -944,7 +942,7 @@ notmuch_message_destroy (notmuch_message_t *message); * showing how to iterate over a notmuch_tags_t object. */ notmuch_bool_t -notmuch_tags_has_more (notmuch_tags_t *tags); +notmuch_tags_valid (notmuch_tags_t *tags); /* Get the current tag from 'tags' as a string. * @@ -957,13 +955,13 @@ notmuch_tags_has_more (notmuch_tags_t *tags); const char * notmuch_tags_get (notmuch_tags_t *tags); -/* Advance the 'tags' iterator to the next tag. +/* Move the 'tags' iterator to the next tag. * * See the documentation of notmuch_message_get_tags for example code * showing how to iterate over a notmuch_tags_t object. */ void -notmuch_tags_advance (notmuch_tags_t *tags); +notmuch_tags_move_to_next (notmuch_tags_t *tags); /* Destroy a notmuch_tags_t object. * @@ -1042,8 +1040,7 @@ notmuch_directory_get_child_directories (notmuch_directory_t *directory); void notmuch_directory_destroy (notmuch_directory_t *directory); -/* Does the given notmuch_filenames_t object contain any more - * filenames. +/* Is the given 'filenames' iterator pointing at a valid filename. * * When this function returns TRUE, notmuch_filenames_get will return * a valid string. Whereas when this function returns FALSE, @@ -1053,7 +1050,7 @@ notmuch_directory_destroy (notmuch_directory_t *directory); * function will always return FALSE. */ notmuch_bool_t -notmuch_filenames_has_more (notmuch_filenames_t *filenames); +notmuch_filenames_valid (notmuch_filenames_t *filenames); /* Get the current filename from 'filenames' as a string. * @@ -1066,13 +1063,13 @@ notmuch_filenames_has_more (notmuch_filenames_t *filenames); const char * notmuch_filenames_get (notmuch_filenames_t *filenames); -/* Advance the 'filenames' iterator to the next filename. +/* Move the 'filenames' iterator to the next filename. * * It is acceptable to pass NULL for 'filenames', in which case this * function will do nothing. */ void -notmuch_filenames_advance (notmuch_filenames_t *filenames); +notmuch_filenames_move_to_next (notmuch_filenames_t *filenames); /* Destroy a notmuch_filenames_t object. * 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; } diff --git a/lib/tags.c b/lib/tags.c index 85507e91..8fe4a3f0 100644 --- a/lib/tags.c +++ b/lib/tags.c @@ -77,7 +77,8 @@ _notmuch_tags_add_tag (notmuch_tags_t *tags, const char *tag) * * The internal creator of 'tags' should call this function before * returning 'tags' to the user to call the public functions such as - * notmuch_tags_has_more, notmuch_tags_get, and notmuch_tags_advance. */ + * notmuch_tags_valid, notmuch_tags_get, and + * notmuch_tags_move_to_next. */ void _notmuch_tags_prepare_iterator (notmuch_tags_t *tags) { @@ -89,7 +90,7 @@ _notmuch_tags_prepare_iterator (notmuch_tags_t *tags) } notmuch_bool_t -notmuch_tags_has_more (notmuch_tags_t *tags) +notmuch_tags_valid (notmuch_tags_t *tags) { return tags->iterator != NULL; } @@ -104,7 +105,7 @@ notmuch_tags_get (notmuch_tags_t *tags) } void -notmuch_tags_advance (notmuch_tags_t *tags) +notmuch_tags_move_to_next (notmuch_tags_t *tags) { if (tags->iterator == NULL) return; diff --git a/lib/thread.cc b/lib/thread.cc index 321937b0..ec80f851 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -119,8 +119,8 @@ _thread_add_message (notmuch_thread_t *thread, } for (tags = notmuch_message_get_tags (message); - notmuch_tags_has_more (tags); - notmuch_tags_advance (tags)) + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { tag = notmuch_tags_get (tags); g_hash_table_insert (thread->tags, xstrdup (tag), NULL); @@ -269,8 +269,8 @@ _notmuch_thread_create (void *ctx, notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST); for (messages = notmuch_query_search_messages (thread_id_query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); _thread_add_message (thread, message); @@ -280,8 +280,8 @@ _notmuch_thread_create (void *ctx, notmuch_query_destroy (thread_id_query); for (messages = notmuch_query_search_messages (matched_query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); _thread_add_matched_message (thread, message); diff --git a/notmuch-dump.c b/notmuch-dump.c index ea326bb6..7e7bc177 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -59,8 +59,8 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) } for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { int first = 1; message = notmuch_messages_get (messages); @@ -69,8 +69,8 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) "%s (", notmuch_message_get_message_id (message)); for (tags = notmuch_message_get_tags (message); - notmuch_tags_has_more (tags); - notmuch_tags_advance (tags)) + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { if (! first) fprintf (output, " "); diff --git a/notmuch-new.c b/notmuch-new.c index f25c71f3..44b50aaa 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -324,7 +324,7 @@ add_files_recursive (notmuch_database_t *notmuch, /* Check if we've walked past any names in db_files or * db_subdirs. If so, these have been deleted. */ - while (notmuch_filenames_has_more (db_files) && + while (notmuch_filenames_valid (db_files) && strcmp (notmuch_filenames_get (db_files), entry->d_name) < 0) { char *absolute = talloc_asprintf (state->removed_files, @@ -333,10 +333,10 @@ add_files_recursive (notmuch_database_t *notmuch, _filename_list_add (state->removed_files, absolute); - notmuch_filenames_advance (db_files); + notmuch_filenames_move_to_next (db_files); } - while (notmuch_filenames_has_more (db_subdirs) && + while (notmuch_filenames_valid (db_subdirs) && strcmp (notmuch_filenames_get (db_subdirs), entry->d_name) <= 0) { const char *filename = notmuch_filenames_get (db_subdirs); @@ -349,7 +349,7 @@ add_files_recursive (notmuch_database_t *notmuch, _filename_list_add (state->removed_directories, absolute); } - notmuch_filenames_advance (db_subdirs); + notmuch_filenames_move_to_next (db_subdirs); } /* If we're looking at a symlink, we only want to add it if it @@ -381,10 +381,10 @@ add_files_recursive (notmuch_database_t *notmuch, } /* Don't add a file that we've added before. */ - if (notmuch_filenames_has_more (db_files) && + if (notmuch_filenames_valid (db_files) && strcmp (notmuch_filenames_get (db_files), entry->d_name) == 0) { - notmuch_filenames_advance (db_files); + notmuch_filenames_move_to_next (db_files); continue; } @@ -456,7 +456,7 @@ add_files_recursive (notmuch_database_t *notmuch, /* Now that we've walked the whole filesystem list, anything left * over in the database lists has been deleted. */ - while (notmuch_filenames_has_more (db_files)) + while (notmuch_filenames_valid (db_files)) { char *absolute = talloc_asprintf (state->removed_files, "%s/%s", path, @@ -464,10 +464,10 @@ add_files_recursive (notmuch_database_t *notmuch, _filename_list_add (state->removed_files, absolute); - notmuch_filenames_advance (db_files); + notmuch_filenames_move_to_next (db_files); } - while (notmuch_filenames_has_more (db_subdirs)) + while (notmuch_filenames_valid (db_subdirs)) { char *absolute = talloc_asprintf (state->removed_directories, "%s/%s", path, @@ -475,7 +475,7 @@ add_files_recursive (notmuch_database_t *notmuch, _filename_list_add (state->removed_directories, absolute); - notmuch_filenames_advance (db_subdirs); + notmuch_filenames_move_to_next (db_subdirs); } if (! interrupted) { @@ -676,8 +676,8 @@ _remove_directory (void *ctx, directory = notmuch_database_get_directory (notmuch, path); for (files = notmuch_directory_get_child_files (directory); - notmuch_filenames_has_more (files); - notmuch_filenames_advance (files)) + notmuch_filenames_valid (files); + notmuch_filenames_move_to_next (files)) { absolute = talloc_asprintf (ctx, "%s/%s", path, notmuch_filenames_get (files)); @@ -690,8 +690,8 @@ _remove_directory (void *ctx, } for (subdirs = notmuch_directory_get_child_directories (directory); - notmuch_filenames_has_more (subdirs); - notmuch_filenames_advance (subdirs)) + notmuch_filenames_valid (subdirs); + notmuch_filenames_move_to_next (subdirs)) { absolute = talloc_asprintf (ctx, "%s/%s", path, notmuch_filenames_get (subdirs)); diff --git a/notmuch-reply.c b/notmuch-reply.c index 98f6442f..6c15536c 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -293,8 +293,8 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ char *reply_headers; for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); @@ -368,8 +368,8 @@ notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, notmuch_q char *reply_headers; for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); diff --git a/notmuch-restore.c b/notmuch-restore.c index 53ce2548..b0a4e1ce 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -93,8 +93,8 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) db_tags_str = NULL; for (db_tags = notmuch_message_get_tags (message); - notmuch_tags_has_more (db_tags); - notmuch_tags_advance (db_tags)) + notmuch_tags_valid (db_tags); + notmuch_tags_move_to_next (db_tags)) { const char *tag = notmuch_tags_get (db_tags); diff --git a/notmuch-search-tags.c b/notmuch-search-tags.c index 7a1305e2..6f3cfccb 100644 --- a/notmuch-search-tags.c +++ b/notmuch-search-tags.c @@ -28,7 +28,7 @@ print_tags (notmuch_tags_t *tags) while ((t = notmuch_tags_get (tags))) { printf ("%s\n", t); - notmuch_tags_advance (tags); + notmuch_tags_move_to_next (tags); } } diff --git a/notmuch-search.c b/notmuch-search.c index 25dd6eba..4e3514b6 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -146,8 +146,8 @@ do_search_threads (const void *ctx, fputs (format->results_start, stdout); for (threads = notmuch_query_search_threads (query); - notmuch_threads_has_more (threads); - notmuch_threads_advance (threads)) + notmuch_threads_valid (threads); + notmuch_threads_move_to_next (threads)) { int first_tag = 1; @@ -174,8 +174,8 @@ do_search_threads (const void *ctx, fputs (format->tag_start, stdout); for (tags = notmuch_thread_get_tags (thread); - notmuch_tags_has_more (tags); - notmuch_tags_advance (tags)) + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { if (! first_tag) fputs (format->tag_sep, stdout); diff --git a/notmuch-show.c b/notmuch-show.c index 1a1d6019..36bb0d30 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -90,8 +90,8 @@ _get_tags_as_string (const void *ctx, notmuch_message_t *message) return NULL; for (tags = notmuch_message_get_tags (message); - notmuch_tags_has_more (tags); - notmuch_tags_advance (tags)) + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { tag = notmuch_tags_get (tags); @@ -355,8 +355,8 @@ show_messages (void *ctx, const show_format_t *format, notmuch_messages_t *messa fputs (format->message_set_start, stdout); for (; - notmuch_messages_has_more (messages); - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { if (!first_set) fputs (format->message_set_sep, stdout); @@ -460,8 +460,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) fputs (format->message_set_start, stdout); for (threads = notmuch_query_search_threads (query); - notmuch_threads_has_more (threads); - notmuch_threads_advance (threads)) + notmuch_threads_valid (threads); + notmuch_threads_move_to_next (threads)) { thread = notmuch_threads_get (threads); diff --git a/notmuch-tag.c b/notmuch-tag.c index 00588a11..8b6f7dc0 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -108,8 +108,8 @@ notmuch_tag_command (void *ctx, unused (int argc), unused (char *argv[])) } for (messages = notmuch_query_search_messages (query); - notmuch_messages_has_more (messages) && !interrupted; - notmuch_messages_advance (messages)) + notmuch_messages_valid (messages) && !interrupted; + notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); -- 2.43.0