|
libc8
CHIP-8 utility library
|
Data Structures | |
| struct | C8_Exception |
| Represents an exception. More... | |
Macros | |
| #define | C8_INVALID_INSTRUCTION_EXCEPTION_MESSAGE "An invalid instruction exists in the input file." |
| #define | C8_TOO_MANY_LABELS_EXCEPTION_MESSAGE "Too many labels are defined in the input file." |
| #define | C8_STACK_OVERFLOW_EXCEPTION_MESSAGE "A stack overflow occurred during execution." |
| #define | C8_INVALID_ARGUMENT_EXCEPTION_MESSAGE "An invalid instruction argument was given." |
| #define | C8_DUPLICATE_LABEL_EXCEPTION_MESSAGE "A label was defined multiple times." |
| #define | C8_INVALID_SYMBOL_EXCEPTION_MESSAGE "An invalid symbol exists in the input file." |
| #define | C8_MEMORY_ALLOCATION_EXCEPTION_MESSAGE "Failed to allocate memory." |
| #define | C8_UNKNOWN_EXCEPTION_MESSAGE "An unknown error has occurred." |
| #define | C8_TOO_MANY_SYMBOLS_EXCEPTION_MESSAGE "Too many symbols exist in the input file." |
| #define | C8_LOAD_FILE_FAILURE_EXCEPTION_MESSAGE "Failed to load file." |
| #define | C8_FILE_TOO_BIG_EXCEPTION_MESSAGE "The given file is too big." |
| #define | C8_INVALID_COLOR_PALETTE_EXCEPTION_MESSAGE "Invalid color palette." |
| #define | C8_INVALID_QUIRK_EXCEPTION_MESSAGE "Invalid quirk." |
| #define | C8_FAILED_GRAPHICS_INITIALIZATION_EXCEPTION_MESSAGE "Failed to initialize graphics." |
| #define | C8_INVALID_FONT_EXCEPTION_MESSAGE "Invalid font." |
| #define | C8_INVALID_CLOCK_SPEED_EXCEPTION_MESSAGE "Clock speed cannot be less than 1." |
| #define | C8_STACK_UNDERFLOW_EXCEPTION_MESSAGE "Stack underflow occurred during execution." |
Functions | |
| void | c8_handle_exception (C8_ExceptionCode code) |
| Handles an exception by printing the corresponding error message to stderr. | |
Variables | |
| const C8_Exception | c8_exceptions [] |
| char | c8_exception [BUFSIZ] |
Message to print when calling c8_handle_exception with a non-zero code. | |
Stuff for handling exceptions.
| #define C8_DUPLICATE_LABEL_EXCEPTION_MESSAGE "A label was defined multiple times." |
| #define C8_FAILED_GRAPHICS_INITIALIZATION_EXCEPTION_MESSAGE "Failed to initialize graphics." |
| #define C8_FILE_TOO_BIG_EXCEPTION_MESSAGE "The given file is too big." |
| #define C8_INVALID_ARGUMENT_EXCEPTION_MESSAGE "An invalid instruction argument was given." |
| #define C8_INVALID_CLOCK_SPEED_EXCEPTION_MESSAGE "Clock speed cannot be less than 1." |
| #define C8_INVALID_COLOR_PALETTE_EXCEPTION_MESSAGE "Invalid color palette." |
| #define C8_INVALID_FONT_EXCEPTION_MESSAGE "Invalid font." |
| #define C8_INVALID_INSTRUCTION_EXCEPTION_MESSAGE "An invalid instruction exists in the input file." |
| #define C8_INVALID_QUIRK_EXCEPTION_MESSAGE "Invalid quirk." |
| #define C8_INVALID_SYMBOL_EXCEPTION_MESSAGE "An invalid symbol exists in the input file." |
| #define C8_LOAD_FILE_FAILURE_EXCEPTION_MESSAGE "Failed to load file." |
| #define C8_MEMORY_ALLOCATION_EXCEPTION_MESSAGE "Failed to allocate memory." |
| #define C8_STACK_OVERFLOW_EXCEPTION_MESSAGE "A stack overflow occurred during execution." |
| #define C8_STACK_UNDERFLOW_EXCEPTION_MESSAGE "Stack underflow occurred during execution." |
| #define C8_TOO_MANY_LABELS_EXCEPTION_MESSAGE "Too many labels are defined in the input file." |
| #define C8_TOO_MANY_SYMBOLS_EXCEPTION_MESSAGE "Too many symbols exist in the input file." |
| #define C8_UNKNOWN_EXCEPTION_MESSAGE "An unknown error has occurred." |
| void c8_handle_exception | ( | C8_ExceptionCode | code | ) |
Handles an exception by printing the corresponding error message to stderr.
| code | The exception code. |
| char c8_exception[BUFSIZ] |
Message to print when calling c8_handle_exception with a non-zero code.
| const C8_Exception c8_exceptions[] |