#include <errno.h>
#include <signal.h>
#include <ctype.h>
+#include <zlib.h>
#include "talloc-extra.h"
#include "crypto.h"
dump_include_t include,
bool gzip_output);
-/* If status is non-zero (i.e. error) print appropriate
+/* If status indicates error print appropriate
* messages to stderr.
*/
int
status_to_exit (notmuch_status_t status);
+notmuch_status_t
+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__));
+#define GZPUTS(file, str) ASSERT_GZBYTES(file, gzputs (file, str));
+
#include "command-line-arguments.h"
extern const char *notmuch_requested_db_uuid;