aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
blob: 2f36034fb47a3f64577e48b8bf0d41e3e953eb9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef UTILS_H
#define UTILS_H

/**
 * 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