aboutsummaryrefslogtreecommitdiff
path: root/notmuch-client.h
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-04-12 22:39:11 -0300
committerDavid Bremner <david@tethera.net>2020-04-13 17:14:50 -0300
commit0d0918f604c5da419c08e3bfae005a4820395997 (patch)
tree5690039aee11b771ca1af0e1be0bf6e0039170ff /notmuch-client.h
parent02112728433cb08ea2501d937a2ca3cb73a0d85b (diff)
cli/dump: define GZPRINTF macro and use it in place of gzprintf
This will at least catch errors, and can be replaced with more sophisticated error handling where appropriate.
Diffstat (limited to 'notmuch-client.h')
-rw-r--r--notmuch-client.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/notmuch-client.h b/notmuch-client.h
index 467e1d84..6cb81820 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -497,6 +497,10 @@ print_status_gzbytes (const char *loc,
gzFile file,
int bytes);
+/* the __location__ macro is defined in talloc.h */
+#define ASSERT_GZBYTES(file, bytes) ((print_status_gzbytes (__location__, file, bytes)) ? exit (1) : 0)
+#define GZPRINTF(file, fmt, ...) ASSERT_GZBYTES (file, gzprintf (file, fmt, ##__VA_ARGS__));
+
#include "command-line-arguments.h"
extern const char *notmuch_requested_db_uuid;