diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2010-05-18 16:05:47 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2010-05-18 16:05:47 +0200 |
commit | 0f8614c42aacb4f0b47fa843541281be97b8a574 (patch) | |
tree | be124b2e817755710ee898d9c69448e85e034d91 /include | |
parent | 276623c694bf18fce145c9a7defb4a9de7460ae9 (diff) | |
download | wolfbones-0f8614c42aacb4f0b47fa843541281be97b8a574.tar.gz wolfbones-0f8614c42aacb4f0b47fa843541281be97b8a574.tar.bz2 |
started to add generic error messages, not sure if that's a very good idea
Diffstat (limited to 'include')
-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 |