/* * Copyright (c) 2016, NORDUnet A/S. * See LICENSE for licensing information. */ #ifndef UTIL_H #define UTIL_H #define DEBUG_CACHE 0 #define DEBUG_WRITE 0 #define DEBUG_READ 0 #define DEBUG_REBUILD 0 #define DEBUG_PORT 0 #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) void set_error(char **error, const char * __restrict, ...) __attribute__ ((__format__ (__printf__, 2, 3))); int calc_padding(int offset, int alignment); void print_entry(node_object node); void print_hex(const void *data, int length); uint64_t read_host64(void *ptr); uint32_t read_be32(void *ptr); uint16_t read_be16(void *ptr); #endif /* Local Variables: */ /* c-file-style: "BSD" */ /* End: */