utils.h 426 Bytes
Newer Older
1 2 3
#ifndef _UTILS_H
#define _UTILS_H

4
#include <stdint.h>
5 6 7 8 9
#include <sys/types.h>

void *calloc_or_fail(size_t size);
void *malloc_or_fail(size_t size);

10
// Converts an hexadecimal ASCII coded digit into its value. **
11
int hex_char_to_hex_value (char c);
12
// Converts an hexadecimal ASCII coded string into its value.**
13
int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int size);
14

15 16
char *itoa(int i);

17
#endif