]> git.notmuchmail.org Git - notmuch/blob - status.c
test: add known broken test for nondestructiveness of count
[notmuch] / status.c
1 #include "notmuch-client.h"
2
3 notmuch_status_t
4 print_status_query (const char *loc,
5                     const notmuch_query_t *query,
6                     notmuch_status_t status)
7 {
8     if (status) {
9         const char *msg;
10         notmuch_database_t *notmuch;
11
12         fprintf (stderr, "%s: %s\n", loc,
13                  notmuch_status_to_string (status));
14
15         notmuch = notmuch_query_get_database (query);
16         msg = notmuch_database_status_string (notmuch);
17         if (msg)
18             fputs (msg, stderr);
19     }
20     return status;
21 }
22
23 notmuch_status_t
24 print_status_database (const char *loc,
25                     const notmuch_database_t *notmuch,
26                     notmuch_status_t status)
27 {
28     if (status) {
29         const char *msg;
30
31         fprintf (stderr, "%s: %s\n", loc,
32                  notmuch_status_to_string (status));
33         msg = notmuch_database_status_string (notmuch);
34         if (msg)
35             fputs (msg, stderr);
36     }
37     return status;
38 }