#include "watch.h"
#include "simple-watch.h"
#include "timeval.h"
+#include "gccmacro.h"
static const AvahiPoll *api = NULL;
static AvahiSimplePoll *simple_poll = NULL;
-static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdata) {
+static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_GCC_UNUSED void *userdata) {
if (event & AVAHI_WATCH_IN) {
ssize_t r;
}
}
-static void wakeup(AvahiTimeout *t, void *userdata) {
+static void wakeup(AvahiTimeout *t, AVAHI_GCC_UNUSED void *userdata) {
static int i = 0;
struct timeval tv;
}
}
-int main(int argc, char *argv[]) {
+int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
struct timeval tv;
simple_poll = avahi_simple_poll_new();
api->timeout_new(api, &tv, wakeup, NULL);
/* Our main loop */
- for (;;)
- if (avahi_simple_poll_iterate(simple_poll, -1) != 0)
- break;
+ avahi_simple_poll_loop(simple_poll);
+
+
+ avahi_simple_poll_free(simple_poll);
return 0;
}