summaryrefslogtreecommitdiff
path: root/c_src/util.h
diff options
context:
space:
mode:
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