From 0625beaa1d3c98298453b6fff8f663085844ea39 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Fri, 13 May 2016 14:51:53 +0200 Subject: Change endian of permdb index file to big-endian --- c_src/util.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'c_src/util.h') diff --git a/c_src/util.h b/c_src/util.h index 9c2b9d6..9713eaa 100644 --- a/c_src/util.h +++ b/c_src/util.h @@ -15,6 +15,14 @@ #define dprintf(category,args) do { if (DEBUG_ ## category) { fprintf args; } } while (0) #define dprinthex(category,data,size) do { if (DEBUG_ ## category) { print_hex(data, size); } } while (0) +#ifndef HTONLL +#define HTONLL(x) htobe64(x) +#endif + +#ifndef NTOHLL +#define NTOHLL(x) be64toh(x) +#endif + void set_error(char **error, const char * __restrict, ...) __attribute__ ((__format__ (__printf__, 2, 3))); @@ -28,13 +36,13 @@ void print_hex(const void *data, int length); uint64_t -read_host64(void *ptr); +read_be64(const void *ptr); uint32_t -read_be32(void *ptr); +read_be32(const void *ptr); uint16_t -read_be16(void *ptr); +read_be16(const void *ptr); #endif -- cgit v1.1