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

void avahi_record_unref ( AvahiRecord r  ) 

Decrease the reference counter of an AvahiRecord by one.

Definition at line 147 of file rr.c.

References AvahiRecord::data, AvahiRecord::key, AvahiRecord::ref, and AvahiKey::type.

                                        {
    assert(r);
    assert(r->ref >= 1);

    if ((--r->ref) <= 0) {
        switch (r->key->type) {

            case AVAHI_DNS_TYPE_SRV:
                avahi_free(r->data.srv.name);
                break;

            case AVAHI_DNS_TYPE_PTR:
            case AVAHI_DNS_TYPE_CNAME:
            case AVAHI_DNS_TYPE_NS:
                avahi_free(r->data.ptr.name);
                break;

            case AVAHI_DNS_TYPE_HINFO:
                avahi_free(r->data.hinfo.cpu);
                avahi_free(r->data.hinfo.os);
                break;

            case AVAHI_DNS_TYPE_TXT:
                avahi_string_list_free(r->data.txt.string_list);
                break;

            case AVAHI_DNS_TYPE_A:
            case AVAHI_DNS_TYPE_AAAA:
                break;
            
            default:
                avahi_free(r->data.generic.data);
        }
        
        avahi_key_unref(r->key);
        avahi_free(r);
    }
}


Generated by  Doxygen 1.6.0   Back to index