#include <sys/types.h>
#include <sys/debug.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include "test_defs.h"
int
main(int argc, char *argv[])
{
test_conv();
test_mbmarshal();
test_msgbuf();
return (0);
}
void
hexdump(const uchar_t *buf, int len)
{
int idx;
char ascii[24];
char *pa = ascii;
memset(ascii, '\0', sizeof (ascii));
idx = 0;
while (len--) {
if ((idx & 15) == 0) {
printf("%04X: ", idx);
pa = ascii;
}
if (*buf > ' ' && *buf <= '~')
*pa++ = *buf;
else
*pa++ = '.';
printf("%02x ", *buf++);
idx++;
if ((idx & 3) == 0) {
*pa++ = ' ';
(void) putchar(' ');
}
if ((idx & 15) == 0) {
*pa = '\0';
printf("%s\n", ascii);
}
}
if ((idx & 15) != 0) {
*pa = '\0';
while ((idx & 15) != 0) {
if ((idx & 3) == 0)
(void) putchar(' ');
printf(" ");
idx++;
}
printf("%s\n", ascii);
}
}