summaryrefslogtreecommitdiff
path: root/c_src/util.h
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-05-13 14:51:53 +0200
committerMagnus Ahltorp <map@kth.se>2016-05-13 15:54:19 +0200
commit0625beaa1d3c98298453b6fff8f663085844ea39 (patch)
tree13890dbf8f9b0d1d733311b059d3169d5aaf2926 /c_src/util.h
parent2b669571d0820971ee25fbd6ef1810108c09f80e (diff)
Change endian of permdb index file to big-endianpermdb-index-endian-2
Diffstat (limited to 'c_src/util.h')
-rw-r--r--c_src/util.h14
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