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);
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);
}
notmuch_bool_t
-notmuch_filenames_has_more (notmuch_filenames_t *filenames)
+notmuch_filenames_valid (notmuch_filenames_t *filenames)
{
if (filenames == NULL)
return NULL;
}
void
-notmuch_filenames_advance (notmuch_filenames_t *filenames)
+notmuch_filenames_move_to_next (notmuch_filenames_t *filenames)
{
if (filenames == NULL)
return;
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);
* 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);
}
}
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;
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);
/* 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 */
* 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);
* ....
* 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);
* ....
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.
*
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.
*
* 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);
* ....
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,
* 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.
*
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.
*
* 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 *
* 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);
* ....
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,
* 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.
*
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.
*
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,
* 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.
*
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.
*
}
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;
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;
}
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;
}
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);
{
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;
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,
}
void
-notmuch_threads_advance (notmuch_threads_t *threads)
+notmuch_threads_move_to_next (notmuch_threads_t *threads)
{
threads->thread_id = NULL;
}
*
* 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)
{
}
notmuch_bool_t
-notmuch_tags_has_more (notmuch_tags_t *tags)
+notmuch_tags_valid (notmuch_tags_t *tags)
{
return tags->iterator != NULL;
}
}
void
-notmuch_tags_advance (notmuch_tags_t *tags)
+notmuch_tags_move_to_next (notmuch_tags_t *tags)
{
if (tags->iterator == NULL)
return;
}
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);
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);
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);
}
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);
"%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, " ");
/* 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,
_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);
_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
}
/* 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;
}
/* 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,
_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,
_filename_list_add (state->removed_directories, absolute);
- notmuch_filenames_advance (db_subdirs);
+ notmuch_filenames_move_to_next (db_subdirs);
}
if (! interrupted) {
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));
}
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));
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);
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);
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);
while ((t = notmuch_tags_get (tags))) {
printf ("%s\n", t);
- notmuch_tags_advance (tags);
+ notmuch_tags_move_to_next (tags);
}
}
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;
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);
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);
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);
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);
}
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);