Add a hexdump() helper function

This commit is contained in:
Andreas Öman 2010-06-17 22:02:28 +00:00
parent 797dc12c3c
commit 44614a448b
2 changed files with 16 additions and 0 deletions

View file

@ -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");
}

View file

@ -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 */