version 1.101, 2015/04/18 18:28:37 |
version 1.102, 2015/07/19 02:52:35 |
|
|
static void sockoptlevelname(int); |
static void sockoptlevelname(int); |
static void ktraceopname(int); |
static void ktraceopname(int); |
|
|
|
static int screenwidth; |
|
|
int |
int |
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
|
|
|
|
def_emul = current = &emulations[0]; /* native */ |
def_emul = current = &emulations[0]; /* native */ |
|
|
|
if (screenwidth == 0) { |
|
struct winsize ws; |
|
|
|
if (fancy && ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && |
|
ws.ws_col > 8) |
|
screenwidth = ws.ws_col; |
|
else |
|
screenwidth = 80; |
|
} |
|
|
while ((ch = getopt(argc, argv, "e:f:dHlm:nRp:Tt:xX")) != -1) |
while ((ch = getopt(argc, argv, "e:f:dHlm:nRp:Tt:xX")) != -1) |
switch (ch) { |
switch (ch) { |
case 'e': |
case 'e': |
|
|
showbuf(unsigned char *dp, size_t datalen) |
showbuf(unsigned char *dp, size_t datalen) |
{ |
{ |
int i, j; |
int i, j; |
static int screenwidth; |
|
int col = 0, width, bpl; |
int col = 0, width, bpl; |
unsigned char visbuf[5], *cp, c; |
unsigned char visbuf[5], *cp, c; |
|
|
if (screenwidth == 0) { |
|
struct winsize ws; |
|
|
|
if (fancy && ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && |
|
ws.ws_col > 8) |
|
screenwidth = ws.ws_col; |
|
else |
|
screenwidth = 80; |
|
} |
|
if (iohex == 1) { |
if (iohex == 1) { |
putchar('\t'); |
putchar('\t'); |
col = 8; |
col = 8; |