Licensing Information
Open Source Used In Cisco DSP IP Cameras 413
else
*list = new;
}
/* Convert a number to ASCII */
static char *_itoa(int num, char *buf)
{
char *sp = buf + 16;
*--sp = 0;
do {
*--sp = (num % 10) + '0';
num /= 10;
} while(num);
return(sp);
}
/* Adjust lines and columns by doing a TIOCGWINSZ */
static void adjust_lines_cols(struct tc_ent **l)
{
struct winsize ws;
char buf[16];
char num[16];
/* Get and check window size. */
if (ioctl(0, TIOCGWINSZ, &ws) < 0 || !ws.ws_row || !ws.ws_col)
return;
/* Fill in li# and co# */
strcpy(buf, "li#");
strcpy(buf + 3, _itoa(ws.ws_row, num));
add_list(l, buf);
strcpy(buf, "co#");
strcpy(buf + 3, _itoa(ws.ws_col, num));
add_list(l, buf);
}
/* See if strings contains terminal name. */
static int tc_comp(char *line, char *term)
{
char *sp, *bp;
int found = 0, x;
int len = strlen(term);
bp = sp = line;
x = *bp;
while(x && x != ':' && x != '\n') {