From 44614a448b215f8c6dd42c3780c56e43652a9982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 17 Jun 2010 22:02:28 +0000 Subject: [PATCH] Add a hexdump() helper function --- src/main.c | 14 ++++++++++++++ src/tvhead.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/main.c b/src/main.c index 3fba6cd4..a057ed6b 100644 --- a/src/main.c +++ b/src/main.c @@ -685,3 +685,17 @@ sri_to_rate(int sri) { return sample_rates[sri & 0xf]; } + + +/** + * + */ +void +hexdump(const char *pfx, const uint8_t *data, int len) +{ + int i; + printf("%s: ", pfx); + for(i = 0; i < len; i++) + printf("%02x.", data[i]); + printf("\n"); +} diff --git a/src/tvhead.h b/src/tvhead.h index edff3426..71a166f2 100644 --- a/src/tvhead.h +++ b/src/tvhead.h @@ -837,4 +837,6 @@ int tvh_open(const char *pathname, int flags, mode_t mode); int tvh_socket(int domain, int type, int protocol); +void hexdump(const char *pfx, const uint8_t *data, int len); + #endif /* TV_HEAD_H */