diff options
Diffstat (limited to 'include/wolf/errors.h')
-rw-r--r-- | include/wolf/errors.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 <sys/types.h> /* 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 |