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

char* avahi_key_to_string ( const AvahiKey k  ) 

Create a textual representation of the specified key. avahi_free() the result!

Definition at line 226 of file rr.c.

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

                                             {
    char class[16], type[16];
    const char *c, *t;

    assert(k);
    assert(k->ref >= 1);

    /* According to RFC3597 */

    if (!(c = avahi_dns_class_to_string(k->clazz))) {
        snprintf(class, sizeof(class), "CLASS%u", k->clazz);
        c = class;
    }

    if (!(t = avahi_dns_type_to_string(k->type))) {
        snprintf(type, sizeof(type), "TYPE%u", k->type);
        t = type;
    }

    return avahi_strdup_printf("%s\t%s\t%s", k->name, c, t);
}


Generated by  Doxygen 1.6.0   Back to index