/** \file core.h The Avahi Multicast DNS and DNS Service Discovery implmentation. */
-/** \example publish-service.c Example how to register a DNS-SD
+/** \example core-publish-service.c Example how to register a DNS-SD
* service using an embedded mDNS stack. It behaves like a network
* printer registering both an IPP and a BSD LPR service. */
-/** \example browse-services.c Example how to browse for DNS-SD
+/** \example core-browse-services.c Example how to browse for DNS-SD
* services using an embedded mDNS stack. */
#include <avahi-common/cdecl.h>
#include <avahi-core/rr.h>
#include <avahi-common/address.h>
-#include <avahi-common/alternative.h>
-#include <avahi-common/error.h>
#include <avahi-common/defs.h>
#include <avahi-common/watch.h>
/** Allocate a new mDNS responder object. */
AvahiServer *avahi_server_new(
- AvahiPoll *api, /**< The main loop adapter */
+ const AvahiPoll *api, /**< The main loop adapter */
const AvahiServerConfig *sc, /**< If non-NULL a pointer to a configuration structure for the server. The server makes an internal deep copy of this structure, so you may free it using avahi_server_config_done() immediately after calling this function. */
AvahiServerCallback callback, /**< A callback which is called whenever the state of the server changes */
void* userdata, /**< An opaque pointer which is passed to the callback function */
AvahiEntryFlags flags,
uint32_t ttl, /**< DNS TTL for this record */
const char *name, /**< TXT record name */
- ... /**< Text record data, terminated by NULL */);
+ ... /**< Text record data, terminated by NULL */) AVAHI_GCC_SENTINEL;
/** Add a PTR RR to the server. Mostly identical to
* avahi_server_add_text but takes a va_list instead of a variable
const char *domain,
const char *host, /**< Host name where this servcie resides, or NULL if on the local host */
uint16_t port, /**< Port number of the service */
- ... /**< Text records, terminated by NULL */);
+ ... /**< Text records, terminated by NULL */) AVAHI_GCC_SENTINEL;
/** Mostly identical to avahi_server_add_service(), but takes an va_list for the TXT records. */
int avahi_server_add_service_va(
AvahiSServiceResolver *r,
AvahiIfIndex interface,
AvahiProtocol protocol,
- AvahiResolverEvent event,
+ AvahiResolverEvent event, /**< Is AVAHI_RESOLVER_FOUND when the service was resolved successfully, and everytime it changes. Is AVAHI_RESOLVER_TIMOUT when the service failed to resolve or disappeared. */
const char *name, /**< Service name */
const char *type, /**< Service Type */
const char *domain,
AvahiStringList *txt, /**< TXT record data */
void* userdata);
-/** Create a new AvahiSServiceResolver object */
+/** Create a new AvahiSServiceResolver object. The specified callback function will be called with the resolved service data. */
AvahiSServiceResolver *avahi_s_service_resolver_new(
AvahiServer *server,
AvahiIfIndex interface,