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

AvahiKey* avahi_key_new ( const char *  name,
uint16_t  clazz,
uint16_t  type 
)

Create a new AvahiKey object. The reference counter will be set to 1.

Definition at line 43 of file rr.c.

References AvahiKey::clazz, AvahiKey::name, AvahiKey::ref, and AvahiKey::type.

                                                                         {
    AvahiKey *k;
    assert(name);

    if (!(k = avahi_new(AvahiKey, 1))) {
        avahi_log_error("avahi_new() failed.");
        return NULL;
    }

    if (!(k->name = avahi_normalize_name_strdup(name))) {
        avahi_log_error("avahi_normalize_name() failed.");
        avahi_free(k);
        return NULL;
    }

    k->ref = 1;
    k->clazz = class;
    k->type = type;

    return k;
}


Generated by  Doxygen 1.6.0   Back to index