util/dump.c: Add hex pretty-print debug helper

This commit is contained in:
Tau
2018-11-08 10:22:26 -05:00
parent d791464dd0
commit f0f45a93a1
3 changed files with 74 additions and 0 deletions

15
util/dump.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include <stddef.h>
#include "hook/iobuf.h"
#ifndef NDEBUG
void dump(const void *ptr, size_t nbytes);
void dump_iobuf(const struct iobuf *iobuf);
void dump_const_iobuf(const struct const_iobuf *iobuf);
#else
#define dump(ptr, nbytes)
#define dump_iobuf(iobuf)
#define dump_const_iobuf(iobuf)
#endif