103#define bj_error_code_is_user (c) (((c >> 24) & 0xFF) > 0x00)
119#define bj_error_code_kind(c) (c & 0x000000FF)
122#define BJ_ERROR_MESSAGE_MAX_LEN 127
General-purpose definitions for Banjo API.
uint32_t code
Error code.
Definition error.h:132
char message[BJ_ERROR_MESSAGE_MAX_LEN+1]
Optional error description.
Definition error.h:133
void bj_set_error(bj_error **p_error, uint32_t code, const char *message)
Fills in a bj_error object with given code and message.
void bj_clear_error(bj_error **p_error)
Clears the given error location.
bj_bool bj_forward_error(bj_error *p_source, bj_error **p_destination)
Forward an error into another error location.
#define BJ_ERROR_MESSAGE_MAX_LEN
Maximum number of characters an error message in bj_error can hold.
Definition error.h:122
bj_bool bj_error_check(const bj_error *p_error, uint32_t code)
Checks if the given error matches the error code.
bj_error_code
A numeric representation of an error in Banjo.
Definition error.h:70
@ BJ_ERROR
General Error (unspecified)
Definition error.h:72
@ BJ_ERROR_CANNOT_ALLOCATE
Cannot allocate the specified memory block.
Definition error.h:78
@ BJ_ERROR_FILE_NOT_FOUND
The requested file was not found.
Definition error.h:77
@ BJ_ERROR_DISPOSE
A system component cannot be terminated properly.
Definition error.h:80
@ BJ_ERROR_SYSTEM
Generic OS error.
Definition error.h:76
@ BJ_ERROR_NONE
No Error.
Definition error.h:71
@ BJ_ERROR_INCORRECT_VALUE
Mismatched expected value.
Definition error.h:87
@ BJ_ERROR_UNSUPPORTED
Unsupported operation error.
Definition error.h:73
@ BJ_ERROR_INVALID_DATA
Incorrect data.
Definition error.h:85
@ BJ_ERROR_NOT_IMPLEMENTED
Unsupported operation error.
Definition error.h:74
@ BJ_ERROR_VIDEO
Error while running video layer.
Definition error.h:89
@ BJ_ERROR_AUDIO
Error while running audio layer.
Definition error.h:91
@ BJ_ERROR_CANNOT_READ_FILE
Error while attempting to read a file.
Definition error.h:83
@ BJ_ERROR_INVALID_FORMAT
Data format does not match expected format.
Definition error.h:86
@ BJ_ERROR_IO
IO-related errors.
Definition error.h:82
@ BJ_ERROR_INITIALIZE
A system component cannot be initalized.
Definition error.h:79
Error structure.
Definition error.h:131
All memory-related functions, including custom allocators.