--- a/src/error.h Sun Feb 22 08:48:21 2009 +0200
+++ b/src/error.h Sun Feb 22 10:16:28 2009 +0200
@@ -50,6 +50,7 @@
_ERROR_CODE( ERR_READ, 0x000401, ERRNO ),
_ERROR_CODE( ERR_READ_EOF, 0x000402, NONE ),
_ERROR_CODE( ERR_WRITE, 0x000403, ERRNO ),
+ _ERROR_CODE( ERR_FCNTL, 0x000404, ERRNO ),
/* GnuTLS errors */
_ERROR_CODE( ERR_GNUTLS_CERT_ALLOC_CRED, 0x010101, GNUTLS ),
@@ -58,6 +59,11 @@
_ERROR_CODE( ERR_GNUTLS_SET_DEFAULT_PRIORITY, 0x010104, GNUTLS ),
_ERROR_CODE( ERR_GNUTLS_CRED_SET, 0x010105, GNUTLS ),
_ERROR_CODE( ERR_GNUTLS_HANDSHAKE, 0x010106, GNUTLS ),
+ _ERROR_CODE( ERR_GNUTLS_RECORD_SEND, 0x010107, GNUTLS ),
+ _ERROR_CODE( ERR_GNUTLS_RECORD_RECV, 0x010108, GNUTLS ),
+
+ /* Libevent errors */
+ _ERROR_CODE( ERR_EVENT_NEW, 0x010201, NONE ),
// mask of bits used for the error_code value
_ERROR_CODE_MASK = 0xffffff,
@@ -106,6 +112,9 @@
/* Compare error_info.code != 0 */
#define IS_ERROR(err_info_ptr) (!!(err_info_ptr)->code)
+/* Compare the err_code/err_extra for an err_info */
+#define MATCH_ERROR(err_info_ptr, err_code, err_extra) ((err_info_ptr)->code == (err_code) && (err_info_ptr)->extra == (err_extra))
+
/* Set error_info.code, but leave err_extra as-is. Evaluates to err_code */
#define SET_ERROR(err_info_ptr, err_code) ((err_info_ptr)->code = (err_code))