From 0f8614c42aacb4f0b47fa843541281be97b8a574 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 18 May 2010 16:05:47 +0200 Subject: started to add generic error messages, not sure if that's a very good idea --- include/wolf/errors.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/wolf/errors.h b/include/wolf/errors.h index c53119f..0b14356 100644 --- a/include/wolf/errors.h +++ b/include/wolf/errors.h @@ -33,6 +33,8 @@ extern "C" { #endif +#include /* for size_t */ + /** * @brief Possible error codes of the various libwolf libraries. */ @@ -47,6 +49,17 @@ typedef enum { WOLF_ERR_TIMEOUT = -7 /**< timeout */ } wolf_error_t; +/** + * Converts the last error into a human readable message. + * + * @param error the error to retrieve the textual representation for + * @param buf the buffer which will hold the error message + * @param buflen the size of the buffer + * + * @returns a pointer to buf for convenience + */ +char *wolf_error_msg( const wolf_error_t error, char *buf, size_t buflen ); + #ifdef __cplusplus } #endif -- cgit v1.2.3-54-g00ecf