version 1.125, 2016/03/22 16:45:07 |
version 1.126, 2016/03/24 05:05:42 |
|
|
static void |
static void |
ktrnamei(const char *cp, size_t len) |
ktrnamei(const char *cp, size_t len) |
{ |
{ |
(void)printf("\"%.*s\"\n", (int)len, cp); |
showbufc(basecol, (unsigned char *)cp, len, VIS_DQ | VIS_TAB | VIS_NL); |
} |
} |
|
|
void |
void |
showbufc(int col, unsigned char *dp, size_t datalen) |
showbufc(int col, unsigned char *dp, size_t datalen, int flags) |
{ |
{ |
int i, j; |
int width; |
int width, bpl; |
unsigned char visbuf[5], *cp; |
unsigned char visbuf[5], *cp, c; |
|
|
|
|
flags |= VIS_CSTYLE; |
putchar('"'); |
putchar('"'); |
col++; |
col++; |
for (; datalen > 0; datalen--, dp++) { |
for (; datalen > 0; datalen--, dp++) { |
(void)vis(visbuf, *dp, VIS_CSTYLE, *(dp+1)); |
(void)vis(visbuf, *dp, flags, *(dp+1)); |
cp = visbuf; |
cp = visbuf; |
|
|
/* |
/* |
|
|
showbuf(unsigned char *dp, size_t datalen) |
showbuf(unsigned char *dp, size_t datalen) |
{ |
{ |
int i, j; |
int i, j; |
int col = 0, width, bpl; |
int col = 0, bpl; |
unsigned char visbuf[5], *cp, c; |
unsigned char c; |
|
|
if (iohex == 1) { |
if (iohex == 1) { |
putchar('\t'); |
putchar('\t'); |
|
|
} |
} |
|
|
(void)printf(" "); |
(void)printf(" "); |
showbufc(7, dp, datalen); |
showbufc(7, dp, datalen, 0); |
} |
} |
|
|
static void |
static void |
|
|
static void |
static void |
ktrexec(const char *ptr, size_t len) |
ktrexec(const char *ptr, size_t len) |
{ |
{ |
char buf[sizeof("[2147483648] = ")]; |
|
int i, col; |
int i, col; |
size_t l; |
size_t l; |
|
|
|
|
l = strnlen(ptr, len); |
l = strnlen(ptr, len); |
col = printf("\t[%d] = ", i++); |
col = printf("\t[%d] = ", i++); |
col += 7; /* tab expands from 1 to 8 columns */ |
col += 7; /* tab expands from 1 to 8 columns */ |
showbufc(col, (unsigned char *)ptr, l); |
showbufc(col, (unsigned char *)ptr, l, VIS_DQ|VIS_TAB|VIS_NL); |
if (l == len) { |
if (l == len) { |
printf("\tunterminated argument\n"); |
printf("\tunterminated argument\n"); |
break; |
break; |