X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fquerier-test.c;h=e1ce913dac02f06058d269316d2a642036e2d966;hb=4d83da07cdbe3cb768bc56f543ee9396b14fb48a;hp=6ba33d095c71b253c25bc636b59a8aa22a0939e8;hpb=11fdf8612c684b0faf85781ef1b2766bf6ea1f0b;p=catta diff --git a/avahi-core/querier-test.c b/avahi-core/querier-test.c index 6ba33d0..e1ce913 100644 --- a/avahi-core/querier-test.c +++ b/avahi-core/querier-test.c @@ -1,18 +1,16 @@ -/* $Id$ */ - /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -65,29 +63,29 @@ static void sb_callback( const char *service_type, const char *domain, AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("SB%i: (%i.%s) <%s> as <%s> in <%s> [%s] cached=%i", b == service_browser1 ? 1 : 2, iface, avahi_proto_to_string(protocol), name, service_type, domain, browser_event_to_string(event), !!(flags & AVAHI_LOOKUP_RESULT_CACHED)); } -static void create_second_service_browser(AvahiTimeout *timeout, void* userdata) { +static void create_second_service_browser(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void* userdata) { service_browser2 = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, DOMAIN, 0, sb_callback, NULL); assert(service_browser2); - + poll_api->timeout_free(timeout); } -static void quit(AvahiTimeout *timeout, void *userdata) { +static void quit(AVAHI_GCC_UNUSED AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *userdata) { avahi_simple_poll_quit(simple_poll); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { struct timeval tv; AvahiServerConfig config; - + simple_poll = avahi_simple_poll_new(); assert(simple_poll); - + poll_api = avahi_simple_poll_get(simple_poll); assert(poll_api); @@ -100,25 +98,25 @@ int main(int argc, char *argv[]) { avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &config.wide_area_servers[0]); config.n_wide_area_servers = 1; config.enable_wide_area = 1; - + server = avahi_server_new(poll_api, &config, NULL, NULL, NULL); assert(server); avahi_server_config_free(&config); service_browser1 = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, DOMAIN, 0, sb_callback, NULL); assert(service_browser1); - + poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 10000, 0), create_second_service_browser, NULL); poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 60000, 0), quit, NULL); - + for (;;) if (avahi_simple_poll_iterate(simple_poll, -1) != 0) break; avahi_server_free(server); avahi_simple_poll_free(simple_poll); - + return 0; }