libc8
CHIP-8 utility library
|
Go to the source code of this file.
Macros | |
#define | VERBOSE_PRINT(a, ...) if (a & ARG_VERBOSE) { printf(__VA_ARGS__); } |
Functions | |
int | hex_to_int (char) |
Get the integer value of hexadecimal ASCII representation. | |
int | parse_int (const char *) |
Parse decimal or hexadecimal integer from s | |
char * | trim (char *) |
Trim leading and trailing whitespace from s | |
Miscellaneous useful functions.
#define VERBOSE_PRINT | ( | a, | |
... | |||
) | if (a & ARG_VERBOSE) { printf(__VA_ARGS__); } |
int hex_to_int | ( | char | c | ) |
Get the integer value of hexadecimal ASCII representation.
c | the char to convert |
int parse_int | ( | const char * | s | ) |
Parse decimal or hexadecimal integer from s
Converts string s
to an integer. Assumes decimal unless the first character is ‘’$'or
'x'`.
s | The string to convert. |
char * trim | ( | char * | s | ) |
Trim leading and trailing whitespace from s
Puts a NULL
character after the last non-whitespace character and returns a pointer to the first non-whitespace character.
s | string to trim |
s
.