avahi  0.7
alternative.h File Reference

Functions to find alternative names for hosts and services in the case of name collision. More...

#include <avahi-common/cdecl.h>

Go to the source code of this file.

Functions

char * avahi_alternative_host_name (const char *s)
 Find an alternative for the specified host name. More...
 
char * avahi_alternative_service_name (const char *s)
 Find an alternative for the specified service name. More...
 

Detailed Description

Functions to find alternative names for hosts and services in the case of name collision.

Definition in file alternative.h.

Function Documentation

◆ avahi_alternative_host_name()

char* avahi_alternative_host_name ( const char *  s)

Find an alternative for the specified host name.

If called with an original host name, "-2" is appended, afterwards the number is increased on each call. (i.e. "foo" becomes "foo-2" becomes "foo-3" and so on.) avahi_free() the result.

◆ avahi_alternative_service_name()

char* avahi_alternative_service_name ( const char *  s)

Find an alternative for the specified service name.

If called with an original service name, " #2" is appended. Afterwards the number is increased on each call (i.e. "foo" becomes "foo #2" becomes "foo #3" and so on.) avahi_free() the result.

Examples:
client-publish-service.c.