diff options
Diffstat (limited to 'include/wolf/errors.h')
-rw-r--r-- | include/wolf/errors.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/wolf/errors.h b/include/wolf/errors.h index ed5ef82..282654b 100644 --- a/include/wolf/errors.h +++ b/include/wolf/errors.h @@ -5,16 +5,19 @@ extern "C" { #endif -typedef signed int error_t; - -#define OK 0 /* no error, everything is fine */ -#define ERR_OUT_OF_MEMORY -1 /* out of memory in malloc */ -#define ERR_INVALID_STATE -2 /* the object is called in an illegal moment */ -#define ERR_INVALID_VALUE -3 /* invalid parameter to a function */ -#define ERR_INTERNAL -4 /* internal error of the object, usualy rare */ -#define ERR_PROGRAMMING -5 /* programming mistake, should not happen */ -#define ERR_NOT_IMPLEMENTED -6 /* not implemented yet */ -#define ERR_TIMEOUT -7 /* timeout */ +/** + * @brief Possible error codes of the various libwolf functions + */ +typedef enum { + WOLF_OK = 0, /**< no error, everything is fine */ + WOLF_ERR_OUT_OF_MEMORY = -1, /**< out of memory in malloc */ + WOLF_ERR_INVALID_STATE = -2, /**< the object is called in an illegal moment */ + WOLF_ERR_INVALID_VALUE = -3, /**< invalid parameter to a function */ + WOLF_ERR_INTERNAL = -4, /**< internal error of the object, usualy rare */ + WOLF_ERR_PROGRAMMING = -5, /**< programming mistake, should not happen */ + WOLF_ERR_NOT_IMPLEMENTED= -6, /**< not implemented yet */ + WOLF_ERR_TIMEOUT = -7 /**< timeout */ +} wolf_error_t; #ifdef __cplusplus } |