diff options
author | kraxel <kraxel> | 2006-01-24 16:41:25 +0000 |
---|---|---|
committer | kraxel <kraxel> | 2006-01-24 16:41:25 +0000 |
commit | 2bc71f882724947307fadcf5f3c7cee81191acb2 (patch) | |
tree | f238dede0e181e49387a07a6eb9e00a42e45a931 /mdns.c | |
parent | 5874585e61bbeec0f63d741d8051da62dd6a8009 (diff) | |
download | xenwatch-2bc71f882724947307fadcf5f3c7cee81191acb2.tar.gz |
- build without avahi.
Diffstat (limited to 'mdns.c')
-rw-r--r-- | mdns.c | 61 |
1 files changed, 41 insertions, 20 deletions
@@ -3,18 +3,21 @@ #include <unistd.h> #include <string.h> -#include <glib.h> - -#include <avahi-client/client.h> -#include <avahi-client/lookup.h> -#include <avahi-common/error.h> -#include <avahi-common/timeval.h> -#include <avahi-glib/glib-watch.h> -#include <avahi-glib/glib-malloc.h> +#ifdef HAVE_AVAHI +# include <glib.h> +# include <avahi-client/client.h> +# include <avahi-client/lookup.h> +# include <avahi-common/error.h> +# include <avahi-common/timeval.h> +# include <avahi-glib/glib-watch.h> +# include <avahi-glib/glib-malloc.h> +#endif #include "list.h" #include "mdns.h" +#ifdef HAVE_AVAHI + /* ---------------------------------------------------------------------- */ static const char *revents[] = { @@ -138,18 +141,6 @@ client_callback(AvahiClient *client, AvahiClientState state, void *userdata) /* ---------------------------------------------------------------------- */ -void mdns_fini(void) -{ - if (client) { - avahi_client_free(client); - client = NULL; - } - if (glib_poll) { - avahi_glib_poll_free(glib_poll); - glib_poll = NULL; - } -} - int mdns_init(void) { int error; @@ -185,3 +176,33 @@ int mdns_browse(const char *service, const char *domain) } return 0; } + +void mdns_fini(void) +{ + if (client) { + avahi_client_free(client); + client = NULL; + } + if (glib_poll) { + avahi_glib_poll_free(glib_poll); + glib_poll = NULL; + } +} + +#else + +int mdns_init(void) +{ + return -1; +} + +int mdns_browse(const char *service, const char *domain) +{ + return -1; +} + +void mdns_fini(void) +{ +} + +#endif |