libc8
CHIP-8 utility library
|
#include <stdio.h>
Go to the source code of this file.
Functions | |
void | handle_exception (int) |
Variables | |
char | c8_exception [EXCEPTION_MESSAGE_SIZE] |
Stuff for handling exceptions.
#define DUPLICATE_LABEL_EXCEPTION (-9) |
#define DUPLICATE_LABEL_EXCEPTION_MESSAGE "A label was defined multiple times." |
#define EXCEPTION_MESSAGE_SIZE 64 |
#define FAILED_GRAPHICS_INITIALIZATION_EXCEPTION (-18) |
#define FAILED_GRAPHICS_INITIALIZATION_EXCEPTION_MESSAGE "Failed to initialize graphics." |
#define FILE_TOO_BIG_EXCEPTION (-15) |
#define FILE_TOO_BIG_EXCEPTION_MESSAGE "The given file is too big." |
#define INVALID_ARGUMENT_EXCEPTION (-7) |
#define INVALID_ARGUMENT_EXCEPTION_INTERNAL (-8) |
#define INVALID_ARGUMENT_EXCEPTION_INTERNAL_MESSAGE "An invalid argument was passed internally." |
#define INVALID_ARGUMENT_EXCEPTION_MESSAGE "An invalid instruction argument was given." |
#define INVALID_COLOR_PALETTE_EXCEPTION (-16) |
#define INVALID_COLOR_PALETTE_EXCEPTION_MESSAGE "Invalid color palette." |
#define INVALID_FONT_EXCEPTION (-19) |
#define INVALID_FONT_EXCEPTION_MESSAGE "Invalid font." |
#define INVALID_INSTRUCTION_EXCEPTION (-4) |
#define INVALID_INSTRUCTION_EXCEPTION_MESSAGE "An invalid instruction exists in the input file." |
#define INVALID_QUIRK_EXCEPTION (-17) |
#define INVALID_QUIRK_EXCEPTION_MESSAGE "Invalid quirk." |
#define INVALID_SYMBOL_EXCEPTION (-10) |
#define INVALID_SYMBOL_EXCEPTION_MESSAGE "An invalid symbol exists in the input file." |
#define LOAD_FILE_FAILURE_EXCEPTION (-14) |
#define LOAD_FILE_FAILURE_EXCEPTION_MESSAGE "Failed to load file." |
#define NULL_ARGUMENT_EXCEPTION (-3) |
#define NULL_ARGUMENT_EXCEPTION_MESSAGE "A NULL argument was passed to a function." |
#define NULLCHECK1 | ( | a | ) |
#define NULLCHECK2 | ( | a, | |
b | |||
) |
#define NULLCHECK3 | ( | a, | |
b, | |||
c | |||
) |
#define STACK_OVERFLOW_EXCEPTION (-6) |
#define STACK_OVERFLOW_EXCEPTION_MESSAGE "A stack overflow occurred during execution." |
#define TOO_MANY_LABELS_EXCEPTION (-5) |
#define TOO_MANY_LABELS_EXCEPTION_MESSAGE "Too many labels are defined in the input file." |
#define TOO_MANY_MALLOCS_EXCEPTION (-11) |
#define TOO_MANY_MALLOCS_EXCEPTION_MESSAGE "Too many mallocs." |
#define TOO_MANY_SYMBOLS_EXCEPTION (-13) |
#define TOO_MANY_SYMBOLS_EXCEPTION_MESSAGE "Too many symbols exist in the input file." |
#define UNKNOWN_EXCEPTION (-12) |
#define UNKNOWN_EXCEPTION_MESSAGE "An unknown error has occurred." |
void handle_exception | ( | int | code | ) |
|
extern |
Message to print when calling handle_exception
with a non-zero code