From 0eb707fdcf1b87e71bb3a9eaa8472d0b05799a3d Mon Sep 17 00:00:00 2001 From: Terry Dawson VK2KTJ Date: Wed, 12 Sep 2001 13:18:43 +0000 Subject: updated libtool, uniformly indented source, corrected small ax25mond Makefile bug --- listen/utils.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'listen/utils.c') diff --git a/listen/utils.c b/listen/utils.c index ce7ecb9..0d978ee 100644 --- a/listen/utils.c +++ b/listen/utils.c @@ -14,33 +14,32 @@ #include "listen.h" -int color = 0; /* Colorized? */ -int sevenbit = 1; /* Are we on a 7-bit terminal? */ -int ibmhack = 0; /* IBM mapping? */ +int color = 0; /* Colorized? */ +int sevenbit = 1; /* Are we on a 7-bit terminal? */ +int ibmhack = 0; /* IBM mapping? */ /* mapping of IBM codepage 437 chars 128-159 to ISO latin1 equivalents * (158 and 159 are mapped to space) */ -unsigned char ibm_map[32] = -{ +unsigned char ibm_map[32] = { 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197, 201, 230, 198, 244, 246, 242, 251, 249, - 255, 214, 220, 162, 163, 165, 32, 32 + 255, 214, 220, 162, 163, 165, 32, 32 }; - + /* * Printf in Technicolor (TM) (available in selected theatres only) */ - + void lprintf(int dtype, char *fmt, ...) { va_list args; char str[1024]; unsigned char *p; chtype ch; - + va_start(args, fmt); vsnprintf(str, 1024, fmt, args); va_end(args); @@ -51,17 +50,17 @@ void lprintf(int dtype, char *fmt, ...) if (sevenbit && ch > 127) ch = '.'; - + if ((ch > 127 && ch < 160) && ibmhack) ch = ibm_map[ch - 128] | A_BOLD; else if ((ch < 32) && (ch != '\n')) ch = (ch + 64) | A_REVERSE; - if ((dtype == T_ADDR) || (dtype == T_PROTOCOL) - || (dtype == T_AXHDR) || (dtype == T_IPHDR) + if ((dtype == T_ADDR) || (dtype == T_PROTOCOL) + || (dtype == T_AXHDR) || (dtype == T_IPHDR) || (dtype == T_ROSEHDR) || (dtype == T_PORT) || (dtype == T_TIMESTAMP)) - ch |= A_BOLD; + ch |= A_BOLD; ch |= COLOR_PAIR(dtype); @@ -76,7 +75,7 @@ void lprintf(int dtype, char *fmt, ...) fflush(stdout); } } - + int initcolor(void) { if (!has_colors) @@ -91,7 +90,7 @@ int initcolor(void) idlok(stdscr, TRUE); /* Use hardware ins/del of the terminal */ nodelay(stdscr, TRUE); /* Make getch() nonblocking */ - /* Pick colors for each type */ + /* Pick colors for each type */ init_pair(T_PORT, COLOR_GREEN, COLOR_BLACK); init_pair(T_DATA, COLOR_WHITE, COLOR_BLACK); init_pair(T_ERROR, COLOR_RED, COLOR_BLACK); @@ -104,8 +103,8 @@ int initcolor(void) init_pair(T_KISS, COLOR_MAGENTA, COLOR_BLACK); init_pair(T_BPQ, COLOR_MAGENTA, COLOR_BLACK); init_pair(T_TCPHDR, COLOR_BLUE, COLOR_BLACK); - init_pair(T_FLEXNET, COLOR_BLUE, COLOR_BLACK); - + init_pair(T_FLEXNET, COLOR_BLUE, COLOR_BLACK); + return 1; } @@ -114,7 +113,7 @@ char *servname(int port, char *proto) { struct servent *serv; static char str[16]; - + if ((serv = getservbyport(htons(port), proto))) strncpy(str, serv->s_name, 16); else -- cgit v1.2.3