--- a/src/error.h Sun Feb 22 07:53:34 2009 +0200
+++ b/src/error.h Sun Feb 22 08:21:22 2009 +0200
@@ -48,7 +48,8 @@
/* Low-level IO errors */
_ERROR_CODE( ERR_READ, 0x000401, ERRNO ),
- _ERROR_CODE( ERR_WRITE, 0x000402, ERRNO ),
+ _ERROR_CODE( ERR_READ_EOF, 0x000402, NONE ),
+ _ERROR_CODE( ERR_WRITE, 0x000403, ERRNO ),
/* GnuTLS errors */
_ERROR_CODE( ERR_GNUTLS_CERT_ALLOC_CRED, 0x010101, GNUTLS ),
@@ -88,7 +89,7 @@
*
* This is returned as a pointer into a statically allocated buffer. It is not re-entrant.
*/
-const char *error_msg (struct error_info *err);
+const char *error_msg (const struct error_info *err);
/** No error, evaulates as logical false */
#define SUCCESS (0)
@@ -123,6 +124,7 @@
#define RETURN_SET_ERROR(err_info_ptr, err_code) do { SET_ERROR(err_info_ptr, err_code); return (err_code); } while (0)
#define RETURN_SET_ERROR_EXTRA(err_info_ptr, err_code, err_extra) do { _SET_ERROR_EXTRA(err_info_ptr, err_code, err_extra); return (err_code); } while (0)
#define RETURN_SET_ERROR_ERRNO(err_info_ptr, err_code) do { _SET_ERROR_ERRNO(err_info_ptr, err_code); return (err_code); } while (0)
+#define RETURN_SET_ERROR_INFO(err_info_ptr, from_ptr) do { SET_ERROR_INFO(err_info_ptr, from_ptr); return (from_ptr->code); } while (0)
/* Same as above, but also do a 'goto error' */
#define JUMP_SET_ERROR(err_info_ptr, err_code) do { SET_ERROR(err_info_ptr, err_code); goto error; } while (0)