diff options
author | Magnus Ahltorp <map@kth.se> | 2016-05-13 14:51:53 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2016-05-13 15:18:50 +0200 |
commit | e7eb75ed94b7743c07171dedadbe856434f4becb (patch) | |
tree | 2e89f84e73012b8a0f59568ea61ba6c93f37cc24 /c_src/util.h | |
parent | c2950323d5a262632aad51579581023dc8693b10 (diff) |
Change endian of permdb index file to big-endianpermdb-index-endian
Diffstat (limited to 'c_src/util.h')
-rw-r--r-- | c_src/util.h | 14 |
1 files changed, 11 insertions, 3 deletions
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 |