int anything;
int enter = 0;
char enter_string[128] = "", ch;
+ fd_set select_rfds;
+ struct timeval select_tv;
/* flush logfile name */
logfile[0] = '\0';
else
SPRINT(buffer,"B%2d: ", j+1);
addstr(buffer);
- if (!m[i].u.i.ptp)
- goto ptmp;
- if (m[i].u.i.l2link && m[i].u.i.block==0)
+ switch(m[i].u.i.busy[j])
{
- ptmp:
- color((m[i].u.i.busy[j])?yellow:blue);
- addstr((m[i].u.i.busy[j])?"busy":"idle");
- } else
- {
- color(red);
- addstr("blk ");
+ case B_STATE_IDLE:
+ if ((!m[i].u.i.l2link && m[i].u.i.ptp) || m[i].u.i.block)
+ {
+ color(red);
+ addstr("blocked ");
+ } else
+ {
+ color(blue);
+ addstr("idle ");
+ }
+ break;
+ case B_STATE_ACTIVATING:
+ color(yellow);
+ addstr("act'ing ");
+ break;
+ case B_STATE_ACTIVE:
+ color(green);
+ addstr("busy ");
+ break;
+ case B_STATE_DEACTIVATING:
+ color(yellow);
+ addstr("dact'ing");
+ break;
+ case B_STATE_EXPORTING:
+ color(yellow);
+ addstr("exp'ing ");
+ break;
+ case B_STATE_REMOTE:
+ color(green);
+ addstr("remote ");
+ break;
+ case B_STATE_IMPORTING:
+ color(yellow);
+ addstr("imp'ing ");
+ break;
}
if (m[i].u.i.port[j])
{
{
buffer[COLS-1] = '\0';
addstr(buffer);
- color(red);
+ color(mangenta);
addch('*');
color(white);
} else
// move(0, 0);
// hline(' ', COLS);
move(0, 0);
- color(white);
+ color(cyan);
msg.u.s.version_string[sizeof(msg.u.s.version_string)-1] = '\0';
SPRINT(buffer, "LCR %s", msg.u.s.version_string);
addstr(buffer);
}
/* display end */
move(LINES-2, 0);
- color(white);
+ color(blue);
hline(ACS_HLINE, COLS);
move(LINES-1, 0);
- color(white);
if (enter)
+ {
+ color(white);
SPRINT(buffer, "-> %s", enter_string);
- else
+ } else
+ {
+ color(cyan);
SPRINT(buffer, "i=interfaces '%s' c=calls '%s' l=log q=quit +-*/=scroll enter", text_interfaces[show_interfaces], text_calls[show_calls]);
+ }
addstr(buffer);
refresh();
{
/* user input in enter mode */
ch = getch();
+ enter_again:
if (ch == 10)
{
FILE *fp;
if (ch>=32 && ch<=126)
{
SCCAT(enter_string, ch);
+ ch = getch();
+ if (ch > 0)
+ goto enter_again;
goto again;
} else
if (ch==8 || ch==127)
{
if (enter_string[0])
enter_string[strlen(enter_string)-1] = '\0';
+ ch = getch();
+ if (ch > 0)
+ goto enter_again;
goto again;
} else
if (ch != 3)
{
- usleep(250000);
+ ch = getch();
+ if (ch > 0)
+ goto enter_again;
+ FD_ZERO(&select_rfds);
+ FD_SET(0, &select_rfds);
+ select_tv.tv_sec = 0;
+ select_tv.tv_usec = 250000;
+ select(1, &select_rfds, NULL, NULL, &select_tv);
goto again;
}
} else
goto again;
default:
- usleep(250000);
+ FD_ZERO(&select_rfds);
+ FD_SET(0, &select_rfds);
+ select_tv.tv_sec = 0;
+ select_tv.tv_usec = 250000;
+ select(1, &select_rfds, NULL, NULL, &select_tv);
goto again;
}
}