Licensing Information
Open Source Used In Cisco DSP IP Cameras 411
char *s, *sp, *bp;
int len;
char *tc_next = NULL;
/* Skip name field. */
for(sp = buf; *sp && *sp != ':'; sp++)
;
if (*sp) *sp++ = 0;
/* Extract capabilities one-by-one. */
while(*sp) {
/* Find end of field. */
bp = sp;
while(*sp && *sp != ':') {
/* Allow escaped ':' */
if (*sp == '\\' && sp[1] == ':') sp++;
sp++;
}
if (*sp) *sp++ = 0;
/* Check for empty field or comments. */
while(*bp == ' ' || *bp == '\t' || *bp == '\n') bp++;
if (*bp == 0 || *bp == ':' || *bp == '.') continue;
/* Is this the "tc" capability? */
if (!tc_next && strncmp(bp, "tc=", 3) == 0) {
tc_next = strsave(bp + 3);
continue;
}
/* Find name of capability. */
if ((s = strchr(bp, '=')) != NULL)
len = s - bp;
else if ((s = strchr(bp, '@')) != NULL)
len = s - bp;
else if ((s = strchr(bp, '#')) != NULL)
len = s - bp;
else len = strlen(bp);
if (len == 0) continue;
/* See if the capability is already in the list. */
if (list) {
for(i = list; i; i = i->next) {
last = i;
if (strncmp(i->cap, bp, len) == 0) break;
}
}
if (list != NULL && i != NULL) continue;