diff options
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index a1b69e1..049e583 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,6 +1,28 @@ #ifndef UTILS_H #define UTILS_H +/** + * Returns whether or not a string is a number. + * + * @param str A string + */ int is_number(char *str); +/** + * Safely allocates memory to the heap. + * + * @param amount The amount of memory to allocate + * @returns The allocated memory. + */ +void *malloc_s(unsigned long amount); + +/** + * Converts a string to a unsigned integer. + * + * @param str A string + * @param err A error destination + * @returns A unsigned integer. + */ +unsigned int str_to_uint(char *str, char **err); + #endif |