1 #include "notmuch-client.h"
4 print_status_query (const char *loc,
5 const notmuch_query_t *query,
6 notmuch_status_t status)
10 notmuch_database_t *notmuch;
12 fprintf (stderr, "%s: %s\n", loc,
13 notmuch_status_to_string (status));
15 notmuch = notmuch_query_get_database (query);
16 msg = notmuch_database_status_string (notmuch);
24 print_status_message (const char *loc,
25 const notmuch_message_t *message,
26 notmuch_status_t status)
30 notmuch_database_t *notmuch;
32 fprintf (stderr, "%s: %s\n", loc,
33 notmuch_status_to_string (status));
35 notmuch = notmuch_message_get_database (message);
36 msg = notmuch_database_status_string (notmuch);
44 print_status_database (const char *loc,
45 const notmuch_database_t *notmuch,
46 notmuch_status_t status)
51 fprintf (stderr, "%s: %s\n", loc,
52 notmuch_status_to_string (status));
53 msg = notmuch_database_status_string (notmuch);
61 status_to_exit (notmuch_status_t status)
64 case NOTMUCH_STATUS_SUCCESS:
66 case NOTMUCH_STATUS_OUT_OF_MEMORY:
67 case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
68 case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID:
69 case NOTMUCH_STATUS_FILE_ERROR:
77 print_status_gzbytes (const char *loc, gzFile file, int bytes)
81 const char *errstr = gzerror (file, &errnum);
82 fprintf (stderr, "%s: zlib error %s (%d)\n", loc, errstr, errnum);
83 return NOTMUCH_STATUS_FILE_ERROR;
85 return NOTMUCH_STATUS_SUCCESS;