Licensing Information
Open Source Used In Cisco DSP IP Cameras 410
{
char *start, *sp;
int len, c, i;
/* Translate escaped characters and hat-notation. */
while((c = *s++)) {
start = s - 1;
if (c == '\\') {
/* Escaped character. */
c = *s++;
if (c >= '0' && c <= '9') {
/* Octal number. */
c -= '0';
i = 0;
while(*s >= '0' && *s <= '9' && ++i < 3) {
c = (c * 8) + (*s - '0');
s++;
}
} else {
/* \r or \n or whatever. */
for(sp = escapes; *sp; sp += 2)
if (c == *sp) {
c = *++sp;
break;
}
}
} else if (c == '^')
/* Hat notation. */
c = *s++ & 0x1f;
/* See if we want to translate. */
if ((c & 0x7f) > 31)
*r++ = c;
else {
len = s - start;
strncpy(r, start, len);
r += len;
}
}
*r++ = 0;
}
/* Build a linked list with capabilities. */
static char *build_list(struct tc_ent **listp, char *buf)
{
struct tc_ent *i, *last = NULL, *list = *listp;