4 #include <avahi-client/client.h>
5 #include <avahi-common/simple-watch.h>
10 void terminate(int sig
) {
11 if (offerServiceBrowser
)
12 avahi_service_browser_free(offerServiceBrowser
);
16 int main(AVAHI_GCC_UNUSED
int argc
, AVAHI_GCC_UNUSED
char*argv
[]) {
17 /* Allocate main loop object */
18 if (!(simple_poll
= avahi_simple_poll_new())) {
19 fprintf(stderr
, "Failed to create simple poll object.\n");
23 /* The client that is going to do the work */
24 client_callback(NULL
, AVAHI_CLIENT_FAILURE
, NULL
);
26 signal(SIGTERM
, terminate
);
28 /* Run the main loop */
29 avahi_simple_poll_loop(simple_poll
);
34 avahi_simple_poll_free(simple_poll
);