util.h 380 B

12345678910111213141516
  1. #ifndef _UTIL_H
  2. #define _UTIL_H
  3. #include <unistd.h>
  4. #include <stdint.h>
  5. #define countof(x) (sizeof(x)/sizeof(*(x)))
  6. #define char_t unsigned char
  7. void writechecksum(uint8_t *address);
  8. void to_hex(char_t *a, const char_t *p, int size);
  9. void id_to_string(char_t *dest, const char_t *src);
  10. int string_to_id(char_t *w, char_t *a);
  11. void* file_raw(char *path, uint32_t *size);
  12. #endif