libc8
CHIP-8 utility library
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1
8#ifndef LIBC8_EXCEPTION_H
9#define LIBC8_EXCEPTION_H
10
11#include <stdio.h>
12
13#define EXCEPTION_MESSAGE_SIZE BUFSIZ
14
15#define C8_EXCEPTION(code, ...) { \
16 snprintf(c8_exception, EXCEPTION_MESSAGE_SIZE, __VA_ARGS__); \
17 handle_exception(code); \
18}
19
20typedef enum {
39
40
45
46void handle_exception(int);
47
48#endif
void handle_exception(int)
Definition: exception.c:62
#define EXCEPTION_MESSAGE_SIZE
Definition: exception.h:13
char c8_exception[BUFSIZ]
Definition: exception.c:60
exception_code_t
Definition: exception.h:20
@ TOO_MANY_SYMBOLS_EXCEPTION
Definition: exception.h:29
@ MEMORY_ALLOCATION_EXCEPTION
Definition: exception.h:27
@ UNKNOWN_EXCEPTION
Definition: exception.h:28
@ INVALID_SYMBOL_EXCEPTION
Definition: exception.h:26
@ FILE_TOO_BIG_EXCEPTION
Definition: exception.h:31
@ TOO_MANY_LABELS_EXCEPTION
Definition: exception.h:22
@ INVALID_QUIRK_EXCEPTION
Definition: exception.h:33
@ INVALID_INSTRUCTION_EXCEPTION
Definition: exception.h:21
@ INVALID_FONT_EXCEPTION
Definition: exception.h:35
@ INVALID_CLOCK_SPEED_EXCEPTION
Definition: exception.h:36
@ STACK_UNDERFLOW_EXCEPTION
Definition: exception.h:37
@ INVALID_ARGUMENT_EXCEPTION
Definition: exception.h:24
@ STACK_OVERFLOW_EXCEPTION
Definition: exception.h:23
@ FAILED_GRAPHICS_INITIALIZATION_EXCEPTION
Definition: exception.h:34
@ INVALID_COLOR_PALETTE_EXCEPTION
Definition: exception.h:32
@ DUPLICATE_LABEL_EXCEPTION
Definition: exception.h:25
@ LOAD_FILE_FAILURE_EXCEPTION
Definition: exception.h:30