+/*
+ * Enumeration of error codes. The strange macro is so that I can
+ * define description arrays in the accompanying source.
+ */
+#define DEFLATE_ERRORLIST(A) \
+ A(DEFLATE_NO_ERR, "success"), \
+ A(DEFLATE_ERR_ZLIB_HEADER, "invalid zlib header"), \
+ A(DEFLATE_ERR_ZLIB_WRONGCOMP, "zlib header specifies non-deflate compression"), \
+ A(DEFLATE_ERR_GZIP_HEADER, "invalid gzip header"), \
+ A(DEFLATE_ERR_GZIP_WRONGCOMP, "gzip header specifies non-deflate compression"), \
+ A(DEFLATE_ERR_GZIP_FHCRC, "gzip header specifies disputed FHCRC flag"), \
+ A(DEFLATE_ERR_SMALL_HUFTABLE, "under-committed Huffman code space"), \
+ A(DEFLATE_ERR_LARGE_HUFTABLE, "over-committed Huffman code space"), \
+ A(DEFLATE_ERR_UNCOMP_HDR, "wrongly formatted header in uncompressed block"), \
+ A(DEFLATE_ERR_CHECKSUM, "incorrect data checksum"), \
+ A(DEFLATE_ERR_INLEN, "incorrect data length"), \
+ A(DEFLATE_ERR_UNEXPECTED_EOF, "unexpected end of data")
+#define DEFLATE_ENUM_DEF(x,y) x
+enum { DEFLATE_ERRORLIST(DEFLATE_ENUM_DEF), DEFLATE_NUM_ERRORS };
+#undef DEFLATE_ENUM_DEF
+
+/*
+ * Arrays mapping the above error codes to, respectively, a text
+ * error string and a textual representation of the symbolic error
+ * code.
+ */
+extern const char *const deflate_error_msg[DEFLATE_NUM_ERRORS];
+extern const char *const deflate_error_sym[DEFLATE_NUM_ERRORS];
+