Logo Search packages:      
Sourcecode: avahi version File versions

AvahiStringList* avahi_string_list_add_pair_arbitrary ( AvahiStringList l,
const char *  key,
const uint8_t *  value,
size_t  size 
)

Same as avahi_string_list_add_pair() but allow strings containing NUL bytes in *value.

Definition at line 406 of file strlst.c.

References AvahiStringList::text.

                                                                                                                              {
    size_t n;
    assert(key);

    if (!value)
        return avahi_string_list_add(l, key);

    n = strlen(key);
    
    if (!(l = avahi_string_list_add_anonymous(l, n + 1 + size)))
        return NULL;

    memcpy(l->text, key, n);
    l->text[n] = '=';
    memcpy(l->text + n + 1, value, size);

    return l;
}


Generated by  Doxygen 1.6.0   Back to index