16#define C8_EXCEPTION_MESSAGE_SIZE BUFSIZ
21#define C8_EXCEPTION(code, ...) \
23 snprintf(c8_exception, C8_EXCEPTION_MESSAGE_SIZE, __VA_ARGS__); \
24 c8_handle_exception(code); \
char c8_exception[BUFSIZ]
Message to print when calling c8_handle_exception with a non-zero code.
Definition: exception.c:46
C8_ExceptionCode
Exception code enum.
Definition: exception.h:30
@ C8_IO_EXCEPTION
Definition: exception.h:34
@ C8_GRAPHICS_EXCEPTION
Definition: exception.h:37
@ C8_AUDIO_EXCEPTION
Definition: exception.h:38
@ C8_STACK_OVERFLOW_EXCEPTION
Definition: exception.h:32
@ C8_INVALID_STATE_EXCEPTION
Definition: exception.h:35
@ C8_STACK_UNDERFLOW_EXCEPTION
Definition: exception.h:33
@ C8_SYNTAX_ERROR_EXCEPTION
Definition: exception.h:31
@ C8_INVALID_PARAMETER_EXCEPTION
Definition: exception.h:36
#define C8_EXCEPTION_MESSAGE_SIZE
Maximum size of exception message.
Definition: exception.h:16
void c8_handle_exception(C8_ExceptionCode)
Handles an exception by printing the corresponding error message to stderr.
Definition: exception.c:53