Licensing Information
Open Source Used In Cisco DSP IP Cameras 414
/* Find the end of this description. */
while(*sp && *sp != ':' && *sp != '|' && *sp != '\n')
sp++;
if (len == (sp - bp) && strncmp(term, bp, len) == 0) {
/* Found it! */
found = 1;
break;
}
x = *sp++;
bp = sp;
}
return(found);
}
/* Load a specific terminal. */
static char *get_one_entry(FILE *tfp, char *term)
{
char line[256];
int status = 0;
char *sp;
char buf[4096];
char *bufp = buf;
if (term == NULL) return(NULL);
/* Start at beginning. */
rewind(tfp);
/* Read line by line. */
while(fgets(line, 256, tfp) != NULL) {
if (line[0] == '#') continue;
/* See if this is what we're looking for. */
if (status == 0 && tc_comp(line, term) == 0) continue;
status = 1;
/* We are reading a description here. */
for(sp = line; *sp == ' ' || *sp == '\t'; sp++)
;
/* Add the rest until nl to the buffer. */
while(*sp && *sp != '\n') {
if (*sp == '\\' && (*(sp + 1) == '\n')) break;
*bufp++ = *sp++;
if (bufp - buf > 4092) {
/* Buffer full, quit. */
*sp = '\n';