char *buffer = NULL;
size_t buffer_size = 0;
+ notmuch_status_t status;
- for (messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch dump", query, status))
+ return EXIT_FAILURE;
+
+ for (;
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages)) {
int first = 1;
notmuch_messages_t *messages;
notmuch_message_t *message;
mime_node_t *root;
+ notmuch_status_t status;
- for (messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch reply", query, status))
+ return 1;
+
+ for (;
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages))
{
notmuch_messages_t *messages;
notmuch_message_t *message;
mime_node_t *node;
+ notmuch_status_t status;
if (notmuch_query_count_messages (query) != 1) {
fprintf (stderr, "Error: search term did not match precisely one message.\n");
return 1;
}
- messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch reply", query, status))
+ return 1;
+
message = notmuch_messages_get (messages);
if (mime_node_open (ctx, message, &(params->crypto), &node) != NOTMUCH_STATUS_SUCCESS)
return 1;
notmuch_message_t *message;
const char *in_reply_to, *orig_references, *references;
char *reply_headers;
+ notmuch_status_t status;
+
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch reply", query, status))
+ return 1;
- for (messages = notmuch_query_search_messages (query);
+ for (;
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages))
{
sprinter_t *format = ctx->format;
time_t date;
int i;
+ notmuch_status_t status;
if (ctx->offset < 0) {
ctx->offset += notmuch_query_count_threads (ctx->query);
ctx->offset = 0;
}
- threads = notmuch_query_search_threads (ctx->query);
- if (threads == NULL)
+ status = notmuch_query_search_threads_st (ctx->query, &threads);
+ if (print_status_query("notmuch search", ctx->query, status))
return 1;
format->begin_list (format);
notmuch_filenames_t *filenames;
sprinter_t *format = ctx->format;
int i;
+ notmuch_status_t status;
if (ctx->offset < 0) {
ctx->offset += notmuch_query_count_messages (ctx->query);
ctx->offset = 0;
}
- messages = notmuch_query_search_messages (ctx->query);
- if (messages == NULL)
+ status = notmuch_query_search_messages_st (ctx->query, &messages);
+ if (print_status_query ("notmuch search", ctx->query, status))
return 1;
format->begin_list (format);
if (strcmp (notmuch_query_get_query_string (query), "*") == 0) {
tags = notmuch_database_get_all_tags (notmuch);
} else {
- messages = notmuch_query_search_messages (query);
- if (messages == NULL)
+ notmuch_status_t status;
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch search", query, status))
return 1;
tags = notmuch_messages_collect_tags (messages);
{
notmuch_messages_t *messages;
notmuch_message_t *message;
+ notmuch_status_t status;
if (notmuch_query_count_messages (query) != 1) {
fprintf (stderr, "Error: search term did not match precisely one message.\n");
return 1;
}
- messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch show", query, status))
+ return 1;
+
message = notmuch_messages_get (messages);
if (message == NULL) {
notmuch_messages_t *messages;
notmuch_status_t status, res = NOTMUCH_STATUS_SUCCESS;
- threads = notmuch_query_search_threads (query);
- if (! threads)
+ status= notmuch_query_search_threads_st (query, &threads);
+ if (print_status_query ("notmuch show", query, status))
return 1;
sp->begin_list (sp);
notmuch_query_t *query;
notmuch_messages_t *messages;
notmuch_message_t *message;
+ notmuch_status_t status;
+
int ret = NOTMUCH_STATUS_SUCCESS;
if (! (flags & TAG_FLAG_REMOVE_ALL)) {
/* tagging is not interested in any special sort order */
notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
- for (messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (print_status_query ("notmuch tag", query, status))
+ return status;
+
+ for (;
notmuch_messages_valid (messages) && ! interrupted;
notmuch_messages_move_to_next (messages)) {
message = notmuch_messages_get (messages);