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