summaryrefslogtreecommitdiffstats
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-09-06 10:15:47 -0300
committerDavid Bremner <david@tethera.net>2015-09-23 08:03:34 -0300
commit6cdd34a4c762c954426f586d514a3e041c1db3b0 (patch)
tree0796ac4592aeeb3f83ed63d7e4b3f282291a4f7e /notmuch-search.c
parentdca72205ab550a6adb22a763a3f86083907b1eba (diff)
cli: convert remainder of CLI to n_q_search_{messages,threads}_st
I think it would be no real problem to cut and paste the gdb based error message test from count to the other clients modified here, but I'm not currently convinced it's worth the trouble since the code path being tested is almost the the same, and the tests are relatively heavyweight.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index 36f58eb8..3c455bfe 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -111,6 +111,7 @@ do_search_threads (search_context_t *ctx)
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);
@@ -118,8 +119,8 @@ do_search_threads (search_context_t *ctx)
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);
@@ -426,6 +427,7 @@ do_search_messages (search_context_t *ctx)
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);
@@ -433,8 +435,8 @@ do_search_messages (search_context_t *ctx)
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);
@@ -522,8 +524,9 @@ do_search_tags (const search_context_t *ctx)
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);