REFACTOR: Completely remade the error handling format. Using pre-defined
error codes and error messages to make it easier to debug problems.
This commit is contained in:
@@ -19,7 +19,7 @@ void
|
||||
transcode_to_jpeg(PPM* in, JPEG* out);
|
||||
|
||||
void
|
||||
transcode_to_ppm(JPEG* input, PPM* out);
|
||||
transcode_to_ppm(JPEG* in, PPM* out);
|
||||
|
||||
PPM
|
||||
inherit_from_jpeg(const JPEG* in, const char fmt);
|
||||
|
||||
@@ -21,6 +21,22 @@
|
||||
#define SHIFT_16 16 /**< Constant shift of 16-Bits */
|
||||
#define SHIFT_24 24 /**< Constant shift of 24-Bits */
|
||||
|
||||
#define SUCCESS 0
|
||||
|
||||
#define FAILURE 1
|
||||
#define ERR_BUF_NULL 20
|
||||
#define ERR_FILE_NULL 21
|
||||
#define ERR_INVALID_SIZE 22
|
||||
#define ERR_CREATION_FAIL 23
|
||||
#define ERR_IMG_NULL 24
|
||||
#define ERR_IMG_NAME_INVALID 25
|
||||
#define ERR_JHEADER 26
|
||||
|
||||
extern const char* error_messages[];
|
||||
|
||||
#define LOG(msg) printf("LOG: %s\n", msg)
|
||||
#define LOGERROR(error_code) printf("ERROR: %s\n", error_messages[error_code])
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Max value for any channel
|
||||
|
||||
Reference in New Issue
Block a user