lib/ovsdb-session.c
/* Parses string 's' into comma-delimited substrings and adds each of them into
 * 'remotes'.  If one of the substrings is of the form "cid:<uuid>", fills
 * '*cid' with the UUID (and omits it from 'remotes'), otherwise initializes
 * '*cid' to UUID_ZERO. */
Parses string 's' into comma-delimited substrings and adds each of them into
'remotes'.
Parses string ' s ' into comma - delimited substrings and adds each of them into ' remotes ' .
void
ovsdb_session_parse_remote(const char *s,
                           struct svec *remotes, struct uuid *cid)
{
    *cid = UUID_ZERO;
    for (;;) {
        s += strspn(s, " \t");
        if (*s == '\0') {
            break;
        }
        const char *delimiter = next_remote(s);
        if (!delimiter) {
            svec_add(remotes, s);
            break;
        }
        svec_add_nocopy(remotes, xmemdup0(s, delimiter - s));
        s = delimiter + 1;
    }
    size_t i;
    for (i = 0; i < remotes->n; i++) {
        const char *name = remotes->names[i];
        struct uuid uuid;
        if (!strncmp(name, "cid:", 4) && uuid_from_string(&uuid, name + 4)) {
            *cid = uuid;
            svec_del(remotes, name);
            break;
        }
    }
}
void ovsdb_session_parse_remote ( const char * s , struct svec * remotes , struct uuid * cid ) { * cid = UUID_ZERO ; for ( ; ; ) { s += strspn ( s , " \t " ) ; if ( * s == ' \0 ' ) { break ; } const char * delimiter = next_remote ( s ) ; if ( ! delimiter ) { svec_add ( remotes , s ) ; break ; } svec_add_nocopy ( remotes , xmemdup0 ( s , delimiter - s ) ) ; s = delimiter + 1 ; } size_t i ; for ( i = 0 ; i < remotes -> n ; i ++ ) { const char * name = remotes -> names [ i ] ; struct uuid uuid ; if ( ! strncmp ( name , " " , 4 ) && uuid_from_string ( & uuid , name + 4 ) ) { * cid = uuid ; svec_del ( remotes , name ) ; break ; } } }
Parses string 's' into comma-delimited substrings and adds each of them into
 'remotes'.
Parses string ' s ' into comma - delimited substrings and adds each of them into ' remotes ' .
/* Skip white space. */ /* Find the start of the next remote  */