notmuch_query_t *query;
size_t i;
int count;
+ unsigned int ucount;
unsigned long revision;
const char *uuid;
int ret = 0;
+ notmuch_status_t status;
query = notmuch_query_create (notmuch, query_str);
if (query == NULL) {
switch (output) {
case OUTPUT_MESSAGES:
- printf ("%u", notmuch_query_count_messages (query));
+ status = notmuch_query_count_messages_st (query, &ucount);
+ if (print_status_query ("notmuch count", query, status))
+ return -1;
+ printf ("%u", ucount);
break;
case OUTPUT_THREADS:
- printf ("%u", notmuch_query_count_threads (query));
+ status = notmuch_query_count_threads_st (query, &ucount);
+ if (print_status_query ("notmuch count", query, status))
+ return -1;
+ printf ("%u", ucount);
break;
case OUTPUT_FILES:
count = count_files (query);
notmuch_messages_t *messages;
notmuch_message_t *message;
mime_node_t *node;
+ unsigned count;
notmuch_status_t status;
- if (notmuch_query_count_messages (query) != 1) {
+ status = notmuch_query_count_messages_st (query, &count);
+ if (print_status_query ("notmuch reply", query, status))
+ return 1;
+
+ if (count != 1) {
fprintf (stderr, "Error: search term did not match precisely one message.\n");
return 1;
}
notmuch_status_t status;
if (ctx->offset < 0) {
- ctx->offset += notmuch_query_count_threads (ctx->query);
+ unsigned count;
+ notmuch_status_t status;
+ status = notmuch_query_count_threads_st (ctx->query, &count);
+ if (print_status_query ("notmuch search", ctx->query, status))
+ return 1;
+
+ ctx->offset += count;
if (ctx->offset < 0)
ctx->offset = 0;
}
notmuch_status_t status;
if (ctx->offset < 0) {
- ctx->offset += notmuch_query_count_messages (ctx->query);
+ unsigned count;
+ notmuch_status_t status;
+ status = notmuch_query_count_messages_st (ctx->query, &count);
+ if (print_status_query ("notmuch search", ctx->query, status))
+ return 1;
+
+ ctx->offset += count;
if (ctx->offset < 0)
ctx->offset = 0;
}
notmuch_messages_t *messages;
notmuch_message_t *message;
notmuch_status_t status;
+ unsigned int count;
- if (notmuch_query_count_messages (query) != 1) {
+ status = notmuch_query_count_messages_st (query, &count);
+ if (print_status_query ("notmuch show", query, status))
+ return 1;
+
+ if (count != 1) {
fprintf (stderr, "Error: search term did not match precisely one message.\n");
return 1;
}