Logo Search packages:      
Sourcecode: avahi version File versions  Download package

AvahiServerConfig* avahi_server_config_copy ( AvahiServerConfig ret,
const AvahiServerConfig c 
)

Make a deep copy of the configuration structure *c to *ret.

Parameters:
ret  destination
c  source

Definition at line 1596 of file server.c.

References avahi_server_config_copy(), AvahiServerConfig::browse_domains, AvahiServerConfig::domain_name, and AvahiServerConfig::host_name.

Referenced by avahi_server_config_copy(), and avahi_server_new().

                                                                                                {
    char *d = NULL, *h = NULL;
    AvahiStringList *l = NULL;
    assert(ret);
    assert(c);

    if (c->host_name)
        if (!(h = avahi_strdup(c->host_name)))
            return NULL;

    if (c->domain_name)
        if (!(d = avahi_strdup(c->domain_name))) {
            avahi_free(h);
            return NULL;
        }

    if (!(l = avahi_string_list_copy(c->browse_domains)) && c->browse_domains) {
        avahi_free(h);
        avahi_free(d);
        return NULL;
    }
    
    *ret = *c;
    ret->host_name = h;
    ret->domain_name = d;
    ret->browse_domains = l;

    return ret;
}


Generated by  Doxygen 1.6.0   Back to index