From 854f901f491ccda79aee11edc3d59109cb229d28 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Oct 2005 21:27:40 +0000 Subject: [PATCH] * avahi-utils: replace python avahi-browse with a version written in C. * remove -Wunused from GCC command line and use "unused" attribute instead * remove AVAHI_CLIENT_S_FAILURE and AVAHI_CLIENT_S_INVALID since these event's are never forwarded to the client anyway * make use of AVAHI_GCC_NORETURN * really send eror code with StateChange DBUS signals * ignore EINTR in avahi_simple_poll_loop() git-svn-id: file:///home/lennart/svn/public/avahi/trunk@879 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/client-test.c | 26 +- avahi-client/client.c | 18 +- avahi-client/client.h | 2 - avahi-client/srv-test.c | 18 +- avahi-common/alternative-test.c | 2 +- avahi-common/dbus-watch-glue.c | 7 +- avahi-common/domain-test.c | 2 +- avahi-common/gccmacro.h | 7 + avahi-common/simple-watch.c | 5 +- avahi-common/strlst-test.c | 2 +- avahi-common/timeval-test.c | 4 +- avahi-common/watch-test.c | 7 +- avahi-compat-howl/address-test.c | 4 +- avahi-compat-howl/address.c | 4 +- avahi-compat-howl/browse-domain-test.c | 15 +- avahi-compat-howl/compat.c | 14 +- avahi-compat-howl/text-test.c | 3 +- avahi-compat-howl/unsupported.c | 748 +++++++++++++------------ avahi-compat-libdns_sd/compat.c | 25 +- avahi-compat-libdns_sd/txt-test.c | 3 +- avahi-compat-libdns_sd/unsupported.c | 90 +-- avahi-core/avahi-reflector.c | 2 +- avahi-core/avahi-test.c | 56 +- avahi-core/browse-dns-server.c | 4 +- avahi-core/browse.c | 2 +- avahi-core/conformance-test.c | 12 +- avahi-core/dns-test.c | 2 +- avahi-core/entry.c | 2 +- avahi-core/hashmap-test.c | 2 +- avahi-core/netlink.c | 2 +- avahi-core/prioq-test.c | 4 +- avahi-core/probe-sched.c | 2 +- avahi-core/querier-test.c | 8 +- avahi-core/querier.c | 2 +- avahi-core/query-sched.c | 2 +- avahi-core/response-sched.c | 4 +- avahi-core/server.c | 2 +- avahi-core/timeeventq-test.c | 2 +- avahi-core/timeeventq.c | 2 +- avahi-core/update-test.c | 6 +- avahi-core/wide-area.c | 2 +- avahi-daemon/dbus-protocol.c | 6 +- avahi-daemon/ini-file-parser-test.c | 2 +- avahi-daemon/main.c | 6 +- avahi-daemon/simple-protocol.c | 20 +- avahi-daemon/static-services.c | 4 +- avahi-discover-standalone/main.c | 32 +- avahi-glib/glib-watch-test.c | 8 +- avahi-glib/glib-watch.c | 2 +- avahi-utils/Makefile.am | 16 +- avahi-utils/avahi-browse.in | 166 ------ configure.ac | 2 +- docs/TODO | 1 + examples/Makefile.am | 1 - examples/client-browse-services.c | 13 +- examples/client-publish-service.c | 8 +- examples/core-browse-services.c | 10 +- examples/core-publish-service.c | 6 +- examples/glib-integration.c | 6 +- 59 files changed, 645 insertions(+), 790 deletions(-) delete mode 100755 avahi-utils/avahi-browse.in diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c index 5c9c092..775eb5d 100644 --- a/avahi-client/client-test.c +++ b/avahi-client/client-test.c @@ -57,7 +57,7 @@ static void avahi_domain_browser_callback( AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { printf ("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, domain, (char*)userdata); @@ -75,7 +75,7 @@ static void avahi_service_resolver_callback( const AvahiAddress *a, uint16_t port, AvahiStringList *txt, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { char addr[64]; @@ -98,7 +98,7 @@ static void avahi_service_browser_callback ( const char *name, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { AvahiServiceResolver *sr; @@ -119,20 +119,20 @@ static void avahi_service_type_browser_callback ( AvahiBrowserEvent event, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type, domain, (char*)userdata); } static void avahi_address_resolver_callback ( - AvahiAddressResolver *r, + AVAHI_GCC_UNUSED AvahiAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const char *name, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { char addr[64]; @@ -151,7 +151,7 @@ static void avahi_host_name_resolver_callback ( AvahiResolverEvent event, const char *name, const AvahiAddress *a, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { AvahiClient *client; @@ -173,21 +173,21 @@ static void avahi_host_name_resolver_callback ( avahi_address_snprint (addr, sizeof (addr), a); printf ("HOST-NAME-RESOLVER: Callback on HostNameResolver, interface (%d), protocol (%d), event (%d), name (%s), address (%s), data (%s)\n", interface, protocol, event, name, addr, (char*)userdata); } -static void test_free_domain_browser(AvahiTimeout *timeout, void* userdata) +static void test_free_domain_browser(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata) { AvahiServiceBrowser *b = userdata; printf ("Freeing domain browser\n"); avahi_service_browser_free (b); } -static void test_free_entry_group (AvahiTimeout *timeout, void* userdata) +static void test_free_entry_group (AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata) { AvahiEntryGroup *g = userdata; printf ("Freeing entry group\n"); avahi_entry_group_free (g); } -static void test_entry_group_reset (AvahiTimeout *timeout, void* userdata) +static void test_entry_group_reset (AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata) { AvahiEntryGroup *g = userdata; @@ -199,7 +199,7 @@ static void test_entry_group_reset (AvahiTimeout *timeout, void* userdata) avahi_entry_group_commit (g); } -static void test_entry_group_update(AvahiTimeout *timeout, void* userdata) { +static void test_entry_group_update(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata) { AvahiEntryGroup *g = userdata; printf ("Updating entry group\n"); @@ -207,12 +207,12 @@ static void test_entry_group_update(AvahiTimeout *timeout, void* userdata) { avahi_entry_group_update_service_txt(g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, "foo=bar3", NULL); } -static void terminate(AvahiTimeout *timeout, void *userdata) { +static void terminate(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[]) { AvahiClient *avahi; AvahiEntryGroup *group, *group2; AvahiDomainBrowser *domain; diff --git a/avahi-client/client.c b/avahi-client/client.c index 915ba31..ce4cfa0 100644 --- a/avahi-client/client.c +++ b/avahi-client/client.c @@ -72,7 +72,6 @@ static void client_set_state (AvahiClient *client, AvahiServerState state) { case AVAHI_CLIENT_S_COLLISION: case AVAHI_CLIENT_S_REGISTERING: - case AVAHI_CLIENT_S_FAILURE: /* Clear cached strings */ avahi_free(client->host_name); @@ -84,7 +83,6 @@ static void client_set_state (AvahiClient *client, AvahiServerState state) { client->domain_name = NULL; break; - case AVAHI_CLIENT_S_INVALID: case AVAHI_CLIENT_S_RUNNING: break; @@ -119,12 +117,12 @@ static DBusHandlerResult filter_func(DBusConnection *bus, DBusMessage *message, } if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { char *name, *old, *new; - if (!(dbus_message_get_args( + if (!dbus_message_get_args( message, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &old, DBUS_TYPE_STRING, &new, - DBUS_TYPE_INVALID) || dbus_error_is_set (&error))) { + DBUS_TYPE_INVALID) || dbus_error_is_set (&error)) { fprintf(stderr, "WARNING: Failed to parse NameOwnerChanged signal: %s\n", error.message); goto fail; @@ -140,14 +138,14 @@ static DBusHandlerResult filter_func(DBusConnection *bus, DBusMessage *message, } else if (dbus_message_is_signal (message, AVAHI_DBUS_INTERFACE_SERVER, "StateChanged")) { int32_t state; - char *e; + char *e = NULL; int c; - if (!(dbus_message_get_args( + if (!dbus_message_get_args( message, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_STRING, &e, - DBUS_TYPE_INVALID) || dbus_error_is_set (&error))) { + DBUS_TYPE_INVALID) || dbus_error_is_set (&error)) { fprintf(stderr, "WARNING: Failed to parse Server.StateChanged signal: %s\n", error.message); goto fail; } @@ -171,11 +169,11 @@ static DBusHandlerResult filter_func(DBusConnection *bus, DBusMessage *message, char *e; int c; - if (!(dbus_message_get_args( + if (!dbus_message_get_args( message, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_STRING, &e, - DBUS_TYPE_INVALID)) || + DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) { fprintf(stderr, "WARNING: Failed to parse EntryGroup.StateChanged signal: %s\n", error.message); goto fail; @@ -261,7 +259,7 @@ static int get_server_state(AvahiClient *client, int *ret_error) { if (!reply || dbus_error_is_set (&error)) goto fail; - if (!(dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID)) || + if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID) || dbus_error_is_set (&error)) goto fail; diff --git a/avahi-client/client.h b/avahi-client/client.h index 4f2250b..5128bd9 100644 --- a/avahi-client/client.h +++ b/avahi-client/client.h @@ -43,11 +43,9 @@ typedef struct AvahiClient AvahiClient; /** States of a client object, a superset of AvahiServerState */ typedef enum { - AVAHI_CLIENT_S_INVALID = AVAHI_SERVER_INVALID, AVAHI_CLIENT_S_REGISTERING = AVAHI_SERVER_REGISTERING, AVAHI_CLIENT_S_RUNNING = AVAHI_SERVER_RUNNING, AVAHI_CLIENT_S_COLLISION = AVAHI_SERVER_COLLISION, - AVAHI_CLIENT_S_FAILURE = AVAHI_SERVER_FAILURE, AVAHI_CLIENT_DISCONNECTED = 100 /**< Lost DBUS connection to the Avahi daemon */ } AvahiClientState; diff --git a/avahi-client/srv-test.c b/avahi-client/srv-test.c index 4e0959e..8ac7b68 100644 --- a/avahi-client/srv-test.c +++ b/avahi-client/srv-test.c @@ -33,24 +33,24 @@ #include static void callback( - AvahiServiceResolver *r, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiServiceResolver *r, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, - const AvahiAddress *a, - uint16_t port, - AvahiStringList *txt, - AvahiLookupResultFlags flags, - void *userdata) { + AVAHI_GCC_UNUSED const AvahiAddress *a, + AVAHI_GCC_UNUSED uint16_t port, + AVAHI_GCC_UNUSED AvahiStringList *txt, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void *userdata) { fprintf(stderr, "%i name=%s type=%s domain=%s host=%s\n", event, name, type, domain, host_name); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiSimplePoll *simple_poll; const AvahiPoll *poll_api; diff --git a/avahi-common/alternative-test.c b/avahi-common/alternative-test.c index 7ec0f33..010478c 100644 --- a/avahi-common/alternative-test.c +++ b/avahi-common/alternative-test.c @@ -28,7 +28,7 @@ #include "alternative.h" #include "malloc.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { char *r = NULL; int i, k; diff --git a/avahi-common/dbus-watch-glue.c b/avahi-common/dbus-watch-glue.c index 46fcc90..b2b4bb2 100644 --- a/avahi-common/dbus-watch-glue.c +++ b/avahi-common/dbus-watch-glue.c @@ -106,8 +106,9 @@ static void dispatch_timeout_callback(AvahiTimeout *t, void *userdata) { connection_data_unref(d); } -static void watch_callback(AvahiWatch *avahi_watch, int fd, AvahiWatchEvent events, void *userdata) { +static void watch_callback(AvahiWatch *avahi_watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEvent events, void *userdata) { DBusWatch *dbus_watch = userdata; + assert(avahi_watch); assert(dbus_watch); @@ -286,7 +287,7 @@ static void remove_timeout(DBusTimeout *dbus_timeout, void *userdata) { timeout->avahi_timeout = NULL; } -static void timeout_toggled(DBusTimeout *dbus_timeout, void *userdata) { +static void timeout_toggled(DBusTimeout *dbus_timeout, AVAHI_GCC_UNUSED void *userdata) { TimeoutData *timeout; assert(dbus_timeout); @@ -296,7 +297,7 @@ static void timeout_toggled(DBusTimeout *dbus_timeout, void *userdata) { update_timeout(timeout); } -static void dispatch_status(DBusConnection *connection, DBusDispatchStatus new_status, void *userdata) { +static void dispatch_status(AVAHI_GCC_UNUSED DBusConnection *connection, DBusDispatchStatus new_status, void *userdata) { ConnectionData *d = userdata; if (new_status == DBUS_DISPATCH_DATA_REMAINS) diff --git a/avahi-common/domain-test.c b/avahi-common/domain-test.c index b765532..c9ff32e 100644 --- a/avahi-common/domain-test.c +++ b/avahi-common/domain-test.c @@ -30,7 +30,7 @@ #include "domain.h" #include "malloc.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { char *s; char t[256], r[256]; const char *p; diff --git a/avahi-common/gccmacro.h b/avahi-common/gccmacro.h index c32a29d..2e427b7 100644 --- a/avahi-common/gccmacro.h +++ b/avahi-common/gccmacro.h @@ -59,6 +59,13 @@ AVAHI_C_DECL_BEGIN #define AVAHI_GCC_NORETURN #endif +#ifdef __GNUC__ +#define AVAHI_GCC_UNUSED __attribute__ ((unused)) +#else +/** Macro for not used parameter */ +#define AVAHI_GCC_UNUSED +#endif + AVAHI_C_DECL_END #endif diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c index 3633521..65d9d18 100644 --- a/avahi-common/simple-watch.c +++ b/avahi-common/simple-watch.c @@ -619,7 +619,7 @@ const AvahiPoll* avahi_simple_poll_get(AvahiSimplePoll *s) { return &s->api; } -static int system_poll(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata) { +static int system_poll(struct pollfd *ufds, unsigned int nfds, int timeout, AVAHI_GCC_UNUSED void *userdata) { return poll(ufds, nfds, timeout); } @@ -640,5 +640,6 @@ int avahi_simple_poll_loop(AvahiSimplePoll *s) { for (;;) if ((r = avahi_simple_poll_iterate(s, -1)) != 0) - return r; + if (r >= 0 || errno != EINTR) + return r; } diff --git a/avahi-common/strlst-test.c b/avahi-common/strlst-test.c index abca86d..68dc472 100644 --- a/avahi-common/strlst-test.c +++ b/avahi-common/strlst-test.c @@ -29,7 +29,7 @@ #include "strlst.h" #include "malloc.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { char *t, *v; uint8_t data[1024]; AvahiStringList *a = NULL, *b, *p; diff --git a/avahi-common/timeval-test.c b/avahi-common/timeval-test.c index 4b594d4..92fcab2 100644 --- a/avahi-common/timeval-test.c +++ b/avahi-common/timeval-test.c @@ -24,9 +24,11 @@ #endif #include + +#include "gccmacro.h" #include "timeval.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { struct timeval a = { 5, 5 }, b; diff --git a/avahi-common/watch-test.c b/avahi-common/watch-test.c index 921a8f7..cd70117 100644 --- a/avahi-common/watch-test.c +++ b/avahi-common/watch-test.c @@ -32,11 +32,12 @@ #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; @@ -52,7 +53,7 @@ static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdat } } -static void wakeup(AvahiTimeout *t, void *userdata) { +static void wakeup(AvahiTimeout *t, AVAHI_GCC_UNUSED void *userdata) { static int i = 0; struct timeval tv; @@ -66,7 +67,7 @@ static void wakeup(AvahiTimeout *t, void *userdata) { } } -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(); diff --git a/avahi-compat-howl/address-test.c b/avahi-compat-howl/address-test.c index 73c356d..05276aa 100644 --- a/avahi-compat-howl/address-test.c +++ b/avahi-compat-howl/address-test.c @@ -26,12 +26,14 @@ #include #include +#include + #include "howl.h" #define ASSERT_SW_OKAY(t) { sw_result r; r = (t); assert(r == SW_OKAY); } #define ASSERT_NOT_NULL(t) { const void* r; r = (t); assert(r); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { sw_ipv4_address a; char t[256]; uint8_t a1, a2, a3, a4; diff --git a/avahi-compat-howl/address.c b/avahi-compat-howl/address.c index c79b34d..1d9fbbe 100644 --- a/avahi-compat-howl/address.c +++ b/avahi-compat-howl/address.c @@ -31,6 +31,8 @@ #include #include +#include + #include "howl.h" #include "warn.h" @@ -137,7 +139,7 @@ sw_result sw_ipv4_address_init_from_this_host(sw_ipv4_address *self) { return SW_OKAY; } -sw_result sw_ipv4_address_fina(sw_ipv4_address self) { +sw_result sw_ipv4_address_fina(AVAHI_GCC_UNUSED sw_ipv4_address self) { AVAHI_WARN_LINKAGE; diff --git a/avahi-compat-howl/browse-domain-test.c b/avahi-compat-howl/browse-domain-test.c index 2eedd48..be99d92 100644 --- a/avahi-compat-howl/browse-domain-test.c +++ b/avahi-compat-howl/browse-domain-test.c @@ -26,20 +26,21 @@ #include #include +#include #include "howl.h" #define ASSERT_SW_OKAY(t) { sw_result _r; _r = (t); assert(_r == SW_OKAY); } #define ASSERT_NOT_NULL(t) { const void* _r; r = (t); assert(_r); } static sw_result reply( - sw_discovery discovery, - sw_discovery_oid oid, + AVAHI_GCC_UNUSED sw_discovery discovery, + AVAHI_GCC_UNUSED sw_discovery_oid oid, sw_discovery_browse_status status, - sw_uint32 interface_index, - sw_const_string name, - sw_const_string type, + AVAHI_GCC_UNUSED sw_uint32 interface_index, + AVAHI_GCC_UNUSED sw_const_string name, + AVAHI_GCC_UNUSED sw_const_string type, sw_const_string domain, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_opaque extra) { switch (status) { case SW_DISCOVERY_BROWSE_ADD_DOMAIN: @@ -61,7 +62,7 @@ static sw_result reply( return SW_OKAY; } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { sw_discovery discovery; sw_discovery_oid oid; diff --git a/avahi-compat-howl/compat.c b/avahi-compat-howl/compat.c index 8e8dd06..9160fdb 100644 --- a/avahi-compat-howl/compat.c +++ b/avahi-compat-howl/compat.c @@ -694,7 +694,6 @@ static void reg_client_callback(oid_data *data, AvahiClientState state) { return; switch (state) { - case AVAHI_CLIENT_S_FAILURE: case AVAHI_CLIENT_DISCONNECTED: reg_report_status(data, SW_DISCOVERY_PUBLISH_INVALID); break; @@ -717,7 +716,6 @@ static void reg_client_callback(oid_data *data, AvahiClientState state) { avahi_entry_group_reset(data->object); break; - case AVAHI_CLIENT_S_INVALID: case AVAHI_CLIENT_S_REGISTERING: /* Ignore */ break; @@ -836,10 +834,10 @@ finish: static void domain_browser_callback( AvahiDomainBrowser *b, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { oid_data* data = userdata; @@ -922,7 +920,7 @@ finish: static void service_resolver_callback( AvahiServiceResolver *r, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, @@ -931,7 +929,7 @@ static void service_resolver_callback( const AvahiAddress *a, uint16_t port, AvahiStringList *txt, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { oid_data* data = userdata; @@ -1031,12 +1029,12 @@ finish: static void service_browser_callback( AvahiServiceBrowser *b, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { oid_data* data = userdata; diff --git a/avahi-compat-howl/text-test.c b/avahi-compat-howl/text-test.c index 995a7f5..fea653c 100644 --- a/avahi-compat-howl/text-test.c +++ b/avahi-compat-howl/text-test.c @@ -26,6 +26,7 @@ #include #include +#include #include "howl.h" #define ASSERT_SW_OKAY(t) { sw_result _r; _r = (t); assert(_r == SW_OKAY); } @@ -65,7 +66,7 @@ static void hexdump(const void* p, size_t size) { } } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { sw_text_record r; sw_text_record_iterator it; char key[255]; diff --git a/avahi-compat-howl/unsupported.c b/avahi-compat-howl/unsupported.c index 09baf13..800b3c3 100644 --- a/avahi-compat-howl/unsupported.c +++ b/avahi-compat-howl/unsupported.c @@ -23,987 +23,999 @@ #include #endif +#include + #include "howl.h" #include "warn.h" -sw_string sw_strdup(sw_const_string str) { +AVAHI_GCC_NORETURN +sw_string sw_strdup(AVAHI_GCC_UNUSED sw_const_string str) { AVAHI_WARN_UNSUPPORTED_ABORT; - return NULL; } +AVAHI_GCC_NORETURN sw_opaque _sw_debug_malloc( - sw_size_t size, - sw_const_string function, - sw_const_string file, - sw_uint32 line) { + AVAHI_GCC_UNUSED sw_size_t size, + AVAHI_GCC_UNUSED sw_const_string function, + AVAHI_GCC_UNUSED sw_const_string file, + AVAHI_GCC_UNUSED sw_uint32 line) { AVAHI_WARN_UNSUPPORTED_ABORT; - return NULL; } +AVAHI_GCC_NORETURN sw_opaque _sw_debug_realloc( - sw_opaque_t mem, - sw_size_t size, - sw_const_string function, - sw_const_string file, - sw_uint32 line) { + AVAHI_GCC_UNUSED sw_opaque_t mem, + AVAHI_GCC_UNUSED sw_size_t size, + AVAHI_GCC_UNUSED sw_const_string function, + AVAHI_GCC_UNUSED sw_const_string file, + AVAHI_GCC_UNUSED sw_uint32 line) { AVAHI_WARN_UNSUPPORTED_ABORT; - return NULL; } void _sw_debug_free( - sw_opaque_t mem, - sw_const_string function, - sw_const_string file, - sw_uint32 line) { + AVAHI_GCC_UNUSED sw_opaque_t mem, + AVAHI_GCC_UNUSED sw_const_string function, + AVAHI_GCC_UNUSED sw_const_string file, + AVAHI_GCC_UNUSED sw_uint32 line) { AVAHI_WARN_UNSUPPORTED; } +AVAHI_GCC_NORETURN sw_const_string sw_strerror(/* howl sucks */) { AVAHI_WARN_UNSUPPORTED_ABORT; - return NULL; } -sw_result sw_timer_init(sw_timer * self) { +sw_result sw_timer_init(AVAHI_GCC_UNUSED sw_timer * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_timer_fina(sw_timer self) { +sw_result sw_timer_fina(AVAHI_GCC_UNUSED sw_timer self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_time_init(sw_time * self) { +sw_result sw_time_init(AVAHI_GCC_UNUSED sw_time * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_time_init_now(sw_time * self) { +sw_result sw_time_init_now(AVAHI_GCC_UNUSED sw_time * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_time_fina(sw_time self) { +sw_result sw_time_fina(AVAHI_GCC_UNUSED sw_time self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } +AVAHI_GCC_NORETURN sw_time sw_time_add( - sw_time self, - sw_time y) { + AVAHI_GCC_UNUSED sw_time self, + AVAHI_GCC_UNUSED sw_time y) { AVAHI_WARN_UNSUPPORTED_ABORT; } +AVAHI_GCC_NORETURN sw_time sw_time_sub( - sw_time self, - sw_time y) { + AVAHI_GCC_UNUSED sw_time self, + AVAHI_GCC_UNUSED sw_time y) { AVAHI_WARN_UNSUPPORTED_ABORT; } +AVAHI_GCC_NORETURN sw_int32 sw_time_cmp( - sw_time self, - sw_time y) { + AVAHI_GCC_UNUSED sw_time self, + AVAHI_GCC_UNUSED sw_time y) { AVAHI_WARN_UNSUPPORTED_ABORT; } sw_result sw_salt_init( - sw_salt * self, - int argc, - char ** argv) { + AVAHI_GCC_UNUSED sw_salt * self, + AVAHI_GCC_UNUSED int argc, + AVAHI_GCC_UNUSED char ** argv) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_salt_fina(sw_salt self) { +sw_result sw_salt_fina(AVAHI_GCC_UNUSED sw_salt self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_register_socket( - sw_salt self, - struct _sw_socket * socket, - sw_socket_event events, - sw_socket_handler handler, - sw_socket_handler_func func, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_socket * _socket, + AVAHI_GCC_UNUSED sw_socket_event events, + AVAHI_GCC_UNUSED sw_socket_handler handler, + AVAHI_GCC_UNUSED sw_socket_handler_func func, + AVAHI_GCC_UNUSED sw_opaque extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_unregister_socket( - sw_salt self, - struct _sw_socket * socket) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_socket * _socket) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_register_timer( - sw_salt self, - struct _sw_timer * timer, - sw_time timeout, - sw_timer_handler handler, - sw_timer_handler_func func, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_timer * timer, + AVAHI_GCC_UNUSED sw_time timeout, + AVAHI_GCC_UNUSED sw_timer_handler handler, + AVAHI_GCC_UNUSED sw_timer_handler_func func, + AVAHI_GCC_UNUSED sw_opaque extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_unregister_timer( - sw_salt self, - struct _sw_timer * timer) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_timer * timer) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_register_network_interface( - sw_salt self, - struct _sw_network_interface * netif, - sw_network_interface_handler handler, - sw_network_interface_handler_func func, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_network_interface * netif, + AVAHI_GCC_UNUSED sw_network_interface_handler handler, + AVAHI_GCC_UNUSED sw_network_interface_handler_func func, + AVAHI_GCC_UNUSED sw_opaque extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_salt_unregister_network_interface_handler(sw_salt self) { +sw_result sw_salt_unregister_network_interface_handler(AVAHI_GCC_UNUSED sw_salt self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_register_signal( - sw_salt self, - struct _sw_signal * signal, - sw_signal_handler handler, - sw_signal_handler_func func, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_signal * _signal, + AVAHI_GCC_UNUSED sw_signal_handler handler, + AVAHI_GCC_UNUSED sw_signal_handler_func func, + AVAHI_GCC_UNUSED sw_opaque extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_salt_unregister_signal( - sw_salt self, - struct _sw_signal * signal) { + AVAHI_GCC_UNUSED sw_salt self, + AVAHI_GCC_UNUSED struct _sw_signal * _signal) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } void sw_print_assert( - int code, - sw_const_string assert_string, - sw_const_string file, - sw_const_string func, - int line) { + AVAHI_GCC_UNUSED int code, + AVAHI_GCC_UNUSED sw_const_string assert_string, + AVAHI_GCC_UNUSED sw_const_string file, + AVAHI_GCC_UNUSED sw_const_string func, + AVAHI_GCC_UNUSED int line) { AVAHI_WARN_UNSUPPORTED; } void sw_print_debug( - int level, - sw_const_string format, + AVAHI_GCC_UNUSED int level, + AVAHI_GCC_UNUSED sw_const_string format, ...) { AVAHI_WARN_UNSUPPORTED; } -sw_result sw_tcp_socket_init(sw_socket * self) { +sw_result sw_tcp_socket_init(AVAHI_GCC_UNUSED sw_socket * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_tcp_socket_init_with_desc( - sw_socket * self, - sw_sockdesc_t desc) { + AVAHI_GCC_UNUSED sw_socket * self, + AVAHI_GCC_UNUSED sw_sockdesc_t desc) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_udp_socket_init( - sw_socket * self) { +sw_result sw_udp_socket_init(AVAHI_GCC_UNUSED sw_socket * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_multicast_socket_init( - sw_socket * self) { +sw_result sw_multicast_socket_init(AVAHI_GCC_UNUSED sw_socket * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_socket_fina(sw_socket self) { +sw_result sw_socket_fina(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_bind( - sw_socket self, - sw_ipv4_address address, - sw_port port) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_ipv4_address address, + AVAHI_GCC_UNUSED sw_port port) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_join_multicast_group( - sw_socket self, - sw_ipv4_address local_address, - sw_ipv4_address multicast_address, - sw_uint32 ttl) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_ipv4_address local_address, + AVAHI_GCC_UNUSED sw_ipv4_address multicast_address, + AVAHI_GCC_UNUSED sw_uint32 ttl) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_socket_leave_multicast_group(sw_socket self) { +sw_result sw_socket_leave_multicast_group(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_listen( - sw_socket self, - int qsize) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED int qsize) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_connect( - sw_socket self, - sw_ipv4_address address, - sw_port port) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_ipv4_address address, + AVAHI_GCC_UNUSED sw_port port) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_accept( - sw_socket self, - sw_socket * socket) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_socket * _socket) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_send( - sw_socket self, - sw_octets buffer, - sw_size_t len, - sw_size_t * bytesWritten) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_octets buffer, + AVAHI_GCC_UNUSED sw_size_t len, + AVAHI_GCC_UNUSED sw_size_t * bytesWritten) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_sendto( - sw_socket self, - sw_octets buffer, - sw_size_t len, - sw_size_t * bytesWritten, - sw_ipv4_address to, - sw_port port) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_octets buffer, + AVAHI_GCC_UNUSED sw_size_t len, + AVAHI_GCC_UNUSED sw_size_t * bytesWritten, + AVAHI_GCC_UNUSED sw_ipv4_address to, + AVAHI_GCC_UNUSED sw_port port) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_recv( - sw_socket self, - sw_octets buffer, - sw_size_t max, - sw_size_t * len) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_octets buffer, + AVAHI_GCC_UNUSED sw_size_t max, + AVAHI_GCC_UNUSED sw_size_t * len) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_recvfrom( - sw_socket self, - sw_octets buffer, - sw_size_t max, - sw_size_t * len, - sw_ipv4_address * from, - sw_port * port, - sw_ipv4_address * dest, - sw_uint32 * interface_index) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_octets buffer, + AVAHI_GCC_UNUSED sw_size_t max, + AVAHI_GCC_UNUSED sw_size_t * len, + AVAHI_GCC_UNUSED sw_ipv4_address * from, + AVAHI_GCC_UNUSED sw_port * port, + AVAHI_GCC_UNUSED sw_ipv4_address * dest, + AVAHI_GCC_UNUSED sw_uint32 * interface_index) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_set_blocking_mode( - sw_socket self, - sw_bool blocking_mode) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_bool blocking_mode) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_set_options( - sw_socket self, - sw_socket_options options) { + AVAHI_GCC_UNUSED sw_socket self, + AVAHI_GCC_UNUSED sw_socket_options options) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_ipv4_address sw_socket_ipv4_address(sw_socket self) { +AVAHI_GCC_NORETURN +sw_ipv4_address sw_socket_ipv4_address(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED_ABORT; } -sw_port sw_socket_port(sw_socket self) { +AVAHI_GCC_NORETURN +sw_port sw_socket_port(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED_ABORT; } -sw_sockdesc_t sw_socket_desc(sw_socket self) { +AVAHI_GCC_NORETURN +sw_sockdesc_t sw_socket_desc(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED_ABORT; } -sw_result sw_socket_close(sw_socket self) { +sw_result sw_socket_close(AVAHI_GCC_UNUSED sw_socket self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_socket_options_init(sw_socket_options * self) { +sw_result sw_socket_options_init(AVAHI_GCC_UNUSED sw_socket_options * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_socket_options_fina(sw_socket_options self) { +sw_result sw_socket_options_fina(AVAHI_GCC_UNUSED sw_socket_options self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_debug( - sw_socket_options self, - sw_bool val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_nodelay( - sw_socket_options self, - sw_bool val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_dontroute( - sw_socket_options self, - sw_bool val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_keepalive( - sw_socket_options self, - sw_bool val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_linger( - sw_socket_options self, - sw_bool onoff, - sw_uint32 linger) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool onoff, + AVAHI_GCC_UNUSED sw_uint32 linger) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_reuseaddr( - sw_socket_options self, - sw_bool val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_bool val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_rcvbuf( - sw_socket_options self, - sw_uint32 val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_uint32 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_socket_options_set_sndbuf( - sw_socket_options self, - sw_uint32 val) { + AVAHI_GCC_UNUSED sw_socket_options self, + AVAHI_GCC_UNUSED sw_uint32 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } +AVAHI_GCC_NORETURN int sw_socket_error_code(void) { AVAHI_WARN_UNSUPPORTED_ABORT; } sw_result sw_corby_orb_init( - sw_corby_orb * self, - sw_salt salt, - const sw_corby_orb_config * config, - sw_corby_orb_observer observer, - sw_corby_orb_observer_func func, - sw_opaque_t extra) { + AVAHI_GCC_UNUSED sw_corby_orb * self, + AVAHI_GCC_UNUSED sw_salt salt, + AVAHI_GCC_UNUSED const sw_corby_orb_config * config, + AVAHI_GCC_UNUSED sw_corby_orb_observer observer, + AVAHI_GCC_UNUSED sw_corby_orb_observer_func func, + AVAHI_GCC_UNUSED sw_opaque_t extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_corby_orb_fina(sw_corby_orb self) { +sw_result sw_corby_orb_fina(AVAHI_GCC_UNUSED sw_corby_orb self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_register_servant( - sw_corby_orb self, - sw_corby_servant servant, - sw_corby_servant_cb cb, - sw_const_string oid, - struct _sw_corby_object ** object, - sw_const_string protocol_name) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_corby_servant servant, + AVAHI_GCC_UNUSED sw_corby_servant_cb cb, + AVAHI_GCC_UNUSED sw_const_string oid, + AVAHI_GCC_UNUSED struct _sw_corby_object ** object, + AVAHI_GCC_UNUSED sw_const_string protocol_name) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_unregister_servant( - sw_corby_orb self, - sw_const_string oid) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_const_string oid) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_register_bidirectional_object( - sw_corby_orb self, - struct _sw_corby_object * object) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED struct _sw_corby_object * object) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_register_channel( - sw_corby_orb self, - struct _sw_corby_channel * channel) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED struct _sw_corby_channel * channel) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_corby_orb_delegate sw_corby_orb_get_delegate(sw_corby_orb self) { +AVAHI_GCC_NORETURN +sw_corby_orb_delegate sw_corby_orb_get_delegate(AVAHI_GCC_UNUSED sw_corby_orb self) { AVAHI_WARN_UNSUPPORTED_ABORT; } sw_result sw_corby_orb_set_delegate( - sw_corby_orb self, - sw_corby_orb_delegate delegate) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_corby_orb_delegate delegate) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_set_observer( - sw_corby_orb self, - sw_corby_orb_observer observer, - sw_corby_orb_observer_func func, - sw_opaque_t extra) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_corby_orb_observer observer, + AVAHI_GCC_UNUSED sw_corby_orb_observer_func func, + AVAHI_GCC_UNUSED sw_opaque_t extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_protocol_to_address( - sw_corby_orb self, - sw_const_string tag, - sw_string addr, - sw_port * port) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_const_string tag, + AVAHI_GCC_UNUSED sw_string addr, + AVAHI_GCC_UNUSED sw_port * port) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_protocol_to_url( - sw_corby_orb self, - sw_const_string tag, - sw_const_string name, - sw_string url, - sw_size_t url_len) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED sw_const_string tag, + AVAHI_GCC_UNUSED sw_const_string name, + AVAHI_GCC_UNUSED sw_string url, + AVAHI_GCC_UNUSED sw_size_t url_len) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_read_channel( - sw_corby_orb self, - struct _sw_corby_channel * channel) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED struct _sw_corby_channel * channel) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_orb_dispatch_message( - sw_corby_orb self, - struct _sw_corby_channel * channel, - struct _sw_corby_message * message, - struct _sw_corby_buffer * buffer, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_orb self, + AVAHI_GCC_UNUSED struct _sw_corby_channel * channel, + AVAHI_GCC_UNUSED struct _sw_corby_message * message, + AVAHI_GCC_UNUSED struct _sw_corby_buffer * buffer, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_corby_message_init(sw_corby_message * self) { +sw_result sw_corby_message_init(AVAHI_GCC_UNUSED sw_corby_message * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_corby_message_fina(sw_corby_message self) { +sw_result sw_corby_message_fina(AVAHI_GCC_UNUSED sw_corby_message self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_corby_buffer_init(sw_corby_buffer * self) { +sw_result sw_corby_buffer_init(AVAHI_GCC_UNUSED sw_corby_buffer * self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_init_with_size( - sw_corby_buffer * self, - sw_size_t size) { + AVAHI_GCC_UNUSED sw_corby_buffer * self, + AVAHI_GCC_UNUSED sw_size_t size) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_init_with_delegate( - sw_corby_buffer * self, - sw_corby_buffer_delegate delegate, - sw_corby_buffer_overflow_func overflow, - sw_corby_buffer_underflow_func underflow, - sw_opaque_t extra) { + AVAHI_GCC_UNUSED sw_corby_buffer * self, + AVAHI_GCC_UNUSED sw_corby_buffer_delegate delegate, + AVAHI_GCC_UNUSED sw_corby_buffer_overflow_func overflow, + AVAHI_GCC_UNUSED sw_corby_buffer_underflow_func underflow, + AVAHI_GCC_UNUSED sw_opaque_t extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_init_with_size_and_delegate( - sw_corby_buffer * self, - sw_size_t size, - sw_corby_buffer_delegate delegate, - sw_corby_buffer_overflow_func overflow, - sw_corby_buffer_underflow_func underflow, - sw_opaque_t extra) { + AVAHI_GCC_UNUSED sw_corby_buffer * self, + AVAHI_GCC_UNUSED sw_size_t size, + AVAHI_GCC_UNUSED sw_corby_buffer_delegate delegate, + AVAHI_GCC_UNUSED sw_corby_buffer_overflow_func overflow, + AVAHI_GCC_UNUSED sw_corby_buffer_underflow_func underflow, + AVAHI_GCC_UNUSED sw_opaque_t extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_result sw_corby_buffer_fina(sw_corby_buffer self) { +sw_result sw_corby_buffer_fina(AVAHI_GCC_UNUSED sw_corby_buffer self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -void sw_corby_buffer_reset(sw_corby_buffer self) { +void sw_corby_buffer_reset(AVAHI_GCC_UNUSED sw_corby_buffer self) { AVAHI_WARN_UNSUPPORTED; } sw_result sw_corby_buffer_set_octets( - sw_corby_buffer self, - sw_octets octets, - sw_size_t size) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_octets octets, + AVAHI_GCC_UNUSED sw_size_t size) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_octets sw_corby_buffer_octets(sw_corby_buffer self) { +sw_octets sw_corby_buffer_octets(AVAHI_GCC_UNUSED sw_corby_buffer self) { AVAHI_WARN_UNSUPPORTED; return NULL; } -sw_size_t sw_corby_buffer_bytes_used(sw_corby_buffer self) { +sw_size_t sw_corby_buffer_bytes_used(AVAHI_GCC_UNUSED sw_corby_buffer self) { AVAHI_WARN_UNSUPPORTED; return 0; } -sw_size_t sw_corby_buffer_size(sw_corby_buffer self) { +sw_size_t sw_corby_buffer_size(AVAHI_GCC_UNUSED sw_corby_buffer self) { AVAHI_WARN_UNSUPPORTED; return 0; } -sw_result sw_corby_buffer_put_int8(sw_corby_buffer self, sw_int8 val) { +sw_result sw_corby_buffer_put_int8( + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int8 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_uint8( - sw_corby_buffer self, - sw_uint8 val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint8 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_int16( - sw_corby_buffer self, - sw_int16 val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int16 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_uint16( - sw_corby_buffer self, - sw_uint16 val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint16 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_int32( - sw_corby_buffer self, - sw_int32 val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int32 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_uint32( - sw_corby_buffer self, - sw_uint32 val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint32 val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_octets( - sw_corby_buffer self, - sw_const_octets val, - sw_size_t size) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_const_octets val, + AVAHI_GCC_UNUSED sw_size_t size) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_sized_octets( - sw_corby_buffer self, - sw_const_octets val, - sw_uint32 len) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_const_octets val, + AVAHI_GCC_UNUSED sw_uint32 len) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_cstring( - sw_corby_buffer self, - sw_const_string val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_const_string val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_object( - sw_corby_buffer self, - const struct _sw_corby_object * object) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED const struct _sw_corby_object * object) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_put_pad( - sw_corby_buffer self, - sw_corby_buffer_pad pad) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_corby_buffer_pad pad) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_int8( - sw_corby_buffer self, - sw_int8 * val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int8 * val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_uint8( - sw_corby_buffer self, - sw_uint8 * val) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint8 * val) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_int16( - sw_corby_buffer self, - sw_int16 * val, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int16 * val, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_uint16( - sw_corby_buffer self, - sw_uint16 * val, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint16 * val, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_int32( - sw_corby_buffer self, - sw_int32 * val, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_int32 * val, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_uint32( - sw_corby_buffer self, - sw_uint32 * val, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_uint32 * val, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_octets( - sw_corby_buffer self, - sw_octets octets, - sw_size_t size) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_octets octets, + AVAHI_GCC_UNUSED sw_size_t size) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_allocate_and_get_sized_octets( - sw_corby_buffer self, - sw_octets * val, - sw_uint32 * size, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_octets * val, + AVAHI_GCC_UNUSED sw_uint32 * size, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_zerocopy_sized_octets( - sw_corby_buffer self, - sw_octets * val, - sw_uint32 * size, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_octets * val, + AVAHI_GCC_UNUSED sw_uint32 * size, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_sized_octets( - sw_corby_buffer self, - sw_octets val, - sw_uint32 * len, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_octets val, + AVAHI_GCC_UNUSED sw_uint32 * len, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_allocate_and_get_cstring( - sw_corby_buffer self, - sw_string * val, - sw_uint32 * len, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_string * val, + AVAHI_GCC_UNUSED sw_uint32 * len, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_zerocopy_cstring( - sw_corby_buffer self, - sw_string * val, - sw_uint32 * len, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_string * val, + AVAHI_GCC_UNUSED sw_uint32 * len, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_cstring( - sw_corby_buffer self, - sw_string val, - sw_uint32 * len, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED sw_string val, + AVAHI_GCC_UNUSED sw_uint32 * len, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_buffer_get_object( - sw_corby_buffer self, - struct _sw_corby_object ** object, - sw_uint8 endian) { + AVAHI_GCC_UNUSED sw_corby_buffer self, + AVAHI_GCC_UNUSED struct _sw_corby_object ** object, + AVAHI_GCC_UNUSED sw_uint8 endian) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_start_request( - sw_corby_channel self, - sw_const_corby_profile profile, - struct _sw_corby_buffer ** buffer, - sw_const_string op, - sw_uint32 oplen, - sw_bool reply_expected) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED sw_const_corby_profile profile, + AVAHI_GCC_UNUSED struct _sw_corby_buffer ** buffer, + AVAHI_GCC_UNUSED sw_const_string op, + AVAHI_GCC_UNUSED sw_uint32 oplen, + AVAHI_GCC_UNUSED sw_bool reply_expected) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_start_reply( - sw_corby_channel self, - struct _sw_corby_buffer ** buffer, - sw_uint32 request_id, - sw_corby_reply_status status) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED struct _sw_corby_buffer ** buffer, + AVAHI_GCC_UNUSED sw_uint32 request_id, + AVAHI_GCC_UNUSED sw_corby_reply_status status) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_send( - sw_corby_channel self, - struct _sw_corby_buffer * buffer, - sw_corby_buffer_observer observer, - sw_corby_buffer_written_func func, - sw_opaque_t extra) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED struct _sw_corby_buffer * buffer, + AVAHI_GCC_UNUSED sw_corby_buffer_observer observer, + AVAHI_GCC_UNUSED sw_corby_buffer_written_func func, + AVAHI_GCC_UNUSED sw_opaque_t extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_recv( - sw_corby_channel self, - sw_salt * salt, - struct _sw_corby_message ** message, - sw_uint32 * request_id, - sw_string * op, - sw_uint32 * op_len, - struct _sw_corby_buffer ** buffer, - sw_uint8 * endian, - sw_bool block) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED sw_salt * salt, + AVAHI_GCC_UNUSED struct _sw_corby_message ** message, + AVAHI_GCC_UNUSED sw_uint32 * request_id, + AVAHI_GCC_UNUSED sw_string * op, + AVAHI_GCC_UNUSED sw_uint32 * op_len, + AVAHI_GCC_UNUSED struct _sw_corby_buffer ** buffer, + AVAHI_GCC_UNUSED sw_uint8 * endian, + AVAHI_GCC_UNUSED sw_bool block) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_last_recv_from( - sw_corby_channel self, - sw_ipv4_address * from, - sw_port * from_port) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED sw_ipv4_address * from, + AVAHI_GCC_UNUSED sw_port * from_port) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_ff( - sw_corby_channel self, - struct _sw_corby_buffer * buffer) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED struct _sw_corby_buffer * buffer) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } -sw_socket sw_corby_channel_socket(sw_corby_channel self) { - AVAHI_WARN_UNSUPPORTED; - return SW_E_NO_IMPL; +AVAHI_GCC_NORETURN +sw_socket sw_corby_channel_socket(AVAHI_GCC_UNUSED sw_corby_channel self) { + AVAHI_WARN_UNSUPPORTED_ABORT; } -sw_result sw_corby_channel_retain(sw_corby_channel self) { +sw_result sw_corby_channel_retain(AVAHI_GCC_UNUSED sw_corby_channel self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_channel_set_delegate( - sw_corby_channel self, - sw_corby_channel_delegate delegate) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED sw_corby_channel_delegate delegate) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } +AVAHI_GCC_NORETURN sw_corby_channel_delegate sw_corby_channel_get_delegate( - sw_corby_channel self) { + AVAHI_GCC_UNUSED sw_corby_channel self) { AVAHI_WARN_UNSUPPORTED_ABORT; } void sw_corby_channel_set_app_data( - sw_corby_channel self, - sw_opaque app_data) { + AVAHI_GCC_UNUSED sw_corby_channel self, + AVAHI_GCC_UNUSED sw_opaque app_data) { AVAHI_WARN_UNSUPPORTED; } -sw_opaque sw_corby_channel_get_app_data(sw_corby_channel self) { +AVAHI_GCC_NORETURN +sw_opaque sw_corby_channel_get_app_data(AVAHI_GCC_UNUSED sw_corby_channel self) { AVAHI_WARN_UNSUPPORTED_ABORT; } -sw_result sw_corby_channel_fina(sw_corby_channel self) { +sw_result sw_corby_channel_fina(AVAHI_GCC_UNUSED sw_corby_channel self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_init_from_url( - sw_corby_object * self, - struct _sw_corby_orb * orb, - sw_const_string url, - sw_socket_options options, - sw_uint32 bufsize) { + AVAHI_GCC_UNUSED sw_corby_object * self, + AVAHI_GCC_UNUSED struct _sw_corby_orb * orb, + AVAHI_GCC_UNUSED sw_const_string url, + AVAHI_GCC_UNUSED sw_socket_options options, + AVAHI_GCC_UNUSED sw_uint32 bufsize) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_fina( - sw_corby_object self) { + AVAHI_GCC_UNUSED sw_corby_object self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_start_request( - sw_corby_object self, - sw_const_string op, - sw_uint32 op_len, - sw_bool reply_expected, - sw_corby_buffer * buffer) { + AVAHI_GCC_UNUSED sw_corby_object self, + AVAHI_GCC_UNUSED sw_const_string op, + AVAHI_GCC_UNUSED sw_uint32 op_len, + AVAHI_GCC_UNUSED sw_bool reply_expected, + AVAHI_GCC_UNUSED sw_corby_buffer * buffer) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_send( - sw_corby_object self, - sw_corby_buffer buffer, - sw_corby_buffer_observer observer, - sw_corby_buffer_written_func func, - sw_opaque extra) { + AVAHI_GCC_UNUSED sw_corby_object self, + AVAHI_GCC_UNUSED sw_corby_buffer buffer, + AVAHI_GCC_UNUSED sw_corby_buffer_observer observer, + AVAHI_GCC_UNUSED sw_corby_buffer_written_func func, + AVAHI_GCC_UNUSED sw_opaque extra) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_recv( - sw_corby_object self, - sw_corby_message * message, - sw_corby_buffer * buffer, - sw_uint8 * endian, - sw_bool block) { + AVAHI_GCC_UNUSED sw_corby_object self, + AVAHI_GCC_UNUSED sw_corby_message * message, + AVAHI_GCC_UNUSED sw_corby_buffer * buffer, + AVAHI_GCC_UNUSED sw_uint8 * endian, + AVAHI_GCC_UNUSED sw_bool block) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_channel( - sw_corby_object self, - sw_corby_channel * channel) { + AVAHI_GCC_UNUSED sw_corby_object self, + AVAHI_GCC_UNUSED sw_corby_channel * channel) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_corby_object_set_channel( - sw_corby_object self, - sw_corby_channel channel) { + AVAHI_GCC_UNUSED sw_corby_object self, + AVAHI_GCC_UNUSED sw_corby_channel channel) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_discovery_publish_host( - sw_discovery self, - sw_uint32 interface_index, - sw_const_string name, - sw_const_string domain, - sw_ipv4_address address, - sw_discovery_publish_reply reply, - sw_opaque extra, - sw_discovery_oid * oid) { + AVAHI_GCC_UNUSED sw_discovery self, + AVAHI_GCC_UNUSED sw_uint32 interface_index, + AVAHI_GCC_UNUSED sw_const_string name, + AVAHI_GCC_UNUSED sw_const_string domain, + AVAHI_GCC_UNUSED sw_ipv4_address address, + AVAHI_GCC_UNUSED sw_discovery_publish_reply reply, + AVAHI_GCC_UNUSED sw_opaque extra, + AVAHI_GCC_UNUSED sw_discovery_oid * oid) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_discovery_publish_update( - sw_discovery self, - sw_discovery_oid oid, - sw_octets text_record, - sw_uint32 text_record_len) { + AVAHI_GCC_UNUSED sw_discovery self, + AVAHI_GCC_UNUSED sw_discovery_oid oid, + AVAHI_GCC_UNUSED sw_octets text_record, + AVAHI_GCC_UNUSED sw_uint32 text_record_len) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_discovery_query_record( - sw_discovery self, - sw_uint32 interface_index, - sw_uint32 flags, - sw_const_string fullname, - sw_uint16 rrtype, - sw_uint16 rrclass, - sw_discovery_query_record_reply reply, - sw_opaque extra, - sw_discovery_oid * oid) { + AVAHI_GCC_UNUSED sw_discovery self, + AVAHI_GCC_UNUSED sw_uint32 interface_index, + AVAHI_GCC_UNUSED sw_uint32 flags, + AVAHI_GCC_UNUSED sw_const_string fullname, + AVAHI_GCC_UNUSED sw_uint16 rrtype, + AVAHI_GCC_UNUSED sw_uint16 rrclass, + AVAHI_GCC_UNUSED sw_discovery_query_record_reply reply, + AVAHI_GCC_UNUSED sw_opaque extra, + AVAHI_GCC_UNUSED sw_discovery_oid * oid) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_text_record_string_iterator_init( - sw_text_record_string_iterator * self, - sw_const_string text_record_string) { + AVAHI_GCC_UNUSED sw_text_record_string_iterator * self, + AVAHI_GCC_UNUSED sw_const_string text_record_string) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_text_record_string_iterator_fina( - sw_text_record_string_iterator self) { + AVAHI_GCC_UNUSED sw_text_record_string_iterator self) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } sw_result sw_text_record_string_iterator_next( - sw_text_record_string_iterator self, - char key[255], - char val[255]) { + AVAHI_GCC_UNUSED sw_text_record_string_iterator self, + AVAHI_GCC_UNUSED char key[255], + AVAHI_GCC_UNUSED char val[255]) { AVAHI_WARN_UNSUPPORTED; return SW_E_NO_IMPL; } diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c index a06ca68..afc9214 100644 --- a/avahi-compat-libdns_sd/compat.c +++ b/avahi-compat-libdns_sd/compat.c @@ -431,12 +431,12 @@ void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdref) { static void service_browser_callback( AvahiServiceBrowser *b, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { DNSServiceRef sdref = userdata; @@ -476,11 +476,6 @@ static void generic_client_callback(AvahiClient *s, AvahiClientState state, void assert(sdref->n_ref >= 1); switch (state) { - case AVAHI_CLIENT_S_FAILURE: - - error = map_error(avahi_client_errno(s)); - - /* Fall through */ case AVAHI_CLIENT_DISCONNECTED: @@ -495,7 +490,6 @@ static void generic_client_callback(AvahiClient *s, AvahiClientState state, void case AVAHI_CLIENT_S_RUNNING: case AVAHI_CLIENT_S_COLLISION: - case AVAHI_CLIENT_S_INVALID: case AVAHI_CLIENT_S_REGISTERING: break; } @@ -563,16 +557,16 @@ finish: static void service_resolver_callback( AvahiServiceResolver *r, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, - const AvahiAddress *a, + AVAHI_GCC_UNUSED const AvahiAddress *a, uint16_t port, AvahiStringList *txt, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { DNSServiceRef sdref = userdata; @@ -695,10 +689,10 @@ int DNSSD_API DNSServiceConstructFullName ( static void domain_browser_callback( AvahiDomainBrowser *b, AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) { DNSServiceRef sdref = userdata; @@ -867,10 +861,6 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us reg_report_error(sdref, kDNSServiceErr_Unknown); break; - case AVAHI_CLIENT_S_FAILURE: - reg_report_error(sdref, map_error(avahi_client_errno(s))); - break; - case AVAHI_CLIENT_S_RUNNING: { int ret; @@ -909,7 +899,6 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us break; - case AVAHI_CLIENT_S_INVALID: case AVAHI_CLIENT_S_REGISTERING: /* Ignore */ break; diff --git a/avahi-compat-libdns_sd/txt-test.c b/avahi-compat-libdns_sd/txt-test.c index 61f1292..5999dd4 100644 --- a/avahi-compat-libdns_sd/txt-test.c +++ b/avahi-compat-libdns_sd/txt-test.c @@ -27,6 +27,7 @@ #include #include +#include #include "dns_sd.h" static void hexdump(const void* p, size_t size) { @@ -64,7 +65,7 @@ static void hexdump(const void* p, size_t size) { } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { const char *r; TXTRecordRef ref; uint8_t l; diff --git a/avahi-compat-libdns_sd/unsupported.c b/avahi-compat-libdns_sd/unsupported.c index 73e4697..0e08ad6 100644 --- a/avahi-compat-libdns_sd/unsupported.c +++ b/avahi-compat-libdns_sd/unsupported.c @@ -23,22 +23,24 @@ #include #endif +#include + #include "dns_sd.h" #include "warn.h" DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord ( - DNSServiceRef sdRef, - DNSRecordRef *RecordRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void *rdata, - uint32_t ttl, - DNSServiceRegisterRecordReply callBack, - void *context) { + AVAHI_GCC_UNUSED DNSServiceRef sdRef, + AVAHI_GCC_UNUSED DNSRecordRef *RecordRef, + AVAHI_GCC_UNUSED DNSServiceFlags flags, + AVAHI_GCC_UNUSED uint32_t interfaceIndex, + AVAHI_GCC_UNUSED const char *fullname, + AVAHI_GCC_UNUSED uint16_t rrtype, + AVAHI_GCC_UNUSED uint16_t rrclass, + AVAHI_GCC_UNUSED uint16_t rdlen, + AVAHI_GCC_UNUSED const void *rdata, + AVAHI_GCC_UNUSED uint32_t ttl, + AVAHI_GCC_UNUSED DNSServiceRegisterRecordReply callBack, + AVAHI_GCC_UNUSED void *context) { AVAHI_WARN_UNSUPPORTED; @@ -46,14 +48,14 @@ DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord ( } DNSServiceErrorType DNSSD_API DNSServiceQueryRecord ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - DNSServiceQueryRecordReply callBack, - void *context) { + AVAHI_GCC_UNUSED DNSServiceRef *sdRef, + AVAHI_GCC_UNUSED DNSServiceFlags flags, + AVAHI_GCC_UNUSED uint32_t interfaceIndex, + AVAHI_GCC_UNUSED const char *fullname, + AVAHI_GCC_UNUSED uint16_t rrtype, + AVAHI_GCC_UNUSED uint16_t rrclass, + AVAHI_GCC_UNUSED DNSServiceQueryRecordReply callBack, + AVAHI_GCC_UNUSED void *context) { AVAHI_WARN_UNSUPPORTED; @@ -61,33 +63,33 @@ DNSServiceErrorType DNSSD_API DNSServiceQueryRecord ( } void DNSSD_API DNSServiceReconfirmRecord ( - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void *rdata) { + AVAHI_GCC_UNUSED DNSServiceFlags flags, + AVAHI_GCC_UNUSED uint32_t interfaceIndex, + AVAHI_GCC_UNUSED const char *fullname, + AVAHI_GCC_UNUSED uint16_t rrtype, + AVAHI_GCC_UNUSED uint16_t rrclass, + AVAHI_GCC_UNUSED uint16_t rdlen, + AVAHI_GCC_UNUSED const void *rdata) { AVAHI_WARN_UNSUPPORTED; return; } -DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(DNSServiceRef *sdRef) { +DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(AVAHI_GCC_UNUSED DNSServiceRef *sdRef) { AVAHI_WARN_UNSUPPORTED; return kDNSServiceErr_Unsupported; } DNSServiceErrorType DNSSD_API DNSServiceAddRecord( - DNSServiceRef sdRef, - DNSRecordRef *RecordRef, - DNSServiceFlags flags, - uint16_t rrtype, - uint16_t rdlen, - const void *rdata, - uint32_t ttl) { + AVAHI_GCC_UNUSED DNSServiceRef sdRef, + AVAHI_GCC_UNUSED DNSRecordRef *RecordRef, + AVAHI_GCC_UNUSED DNSServiceFlags flags, + AVAHI_GCC_UNUSED uint16_t rrtype, + AVAHI_GCC_UNUSED uint16_t rdlen, + AVAHI_GCC_UNUSED const void *rdata, + AVAHI_GCC_UNUSED uint32_t ttl) { AVAHI_WARN_UNSUPPORTED; @@ -95,12 +97,12 @@ DNSServiceErrorType DNSSD_API DNSServiceAddRecord( } DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord( - DNSServiceRef sdRef, - DNSRecordRef RecordRef, - DNSServiceFlags flags, - uint16_t rdlen, - const void *rdata, - uint32_t ttl) { + AVAHI_GCC_UNUSED DNSServiceRef sdRef, + AVAHI_GCC_UNUSED DNSRecordRef RecordRef, + AVAHI_GCC_UNUSED DNSServiceFlags flags, + AVAHI_GCC_UNUSED uint16_t rdlen, + AVAHI_GCC_UNUSED const void *rdata, + AVAHI_GCC_UNUSED uint32_t ttl) { AVAHI_WARN_UNSUPPORTED; @@ -108,9 +110,9 @@ DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord( } DNSServiceErrorType DNSSD_API DNSServiceRemoveRecord( - DNSServiceRef sdRef, - DNSRecordRef RecordRef, - DNSServiceFlags flags) { + AVAHI_GCC_UNUSED DNSServiceRef sdRef, + AVAHI_GCC_UNUSED DNSRecordRef RecordRef, + AVAHI_GCC_UNUSED DNSServiceFlags flags) { AVAHI_WARN_UNSUPPORTED; diff --git a/avahi-core/avahi-reflector.c b/avahi-core/avahi-reflector.c index d4a8947..a383965 100644 --- a/avahi-core/avahi-reflector.c +++ b/avahi-core/avahi-reflector.c @@ -31,7 +31,7 @@ #include #include -int main(int argc, char*argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { AvahiServer *server; AvahiServerConfig config; int error; diff --git a/avahi-core/avahi-test.c b/avahi-core/avahi-test.c index 51a3a03..9123bfe 100644 --- a/avahi-core/avahi-test.c +++ b/avahi-core/avahi-test.c @@ -47,13 +47,13 @@ static char *service_name = NULL; static const AvahiPoll *poll_api; -static void quit_timeout_callback(AvahiTimeout *timeout, void* userdata) { +static void quit_timeout_callback(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata) { AvahiSimplePoll *simple_poll = userdata; avahi_simple_poll_quit(simple_poll); } -static void dump_line(const char *text, void* userdata) { +static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) { printf("%s\n", text); } @@ -93,8 +93,8 @@ static void record_browser_callback( AvahiProtocol protocol, AvahiBrowserEvent event, AvahiRecord *record, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { char *t; assert(r); @@ -110,7 +110,7 @@ static void record_browser_callback( static void remove_entries(void); static void create_entries(int new_name); -static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata) { +static void entry_group_callback(AVAHI_GCC_UNUSED AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("entry group state: %i", state); if (state == AVAHI_ENTRY_GROUP_COLLISION) { @@ -122,7 +122,7 @@ static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntry } } -static void server_callback(AvahiServer *s, AvahiServerState state, void* userdata) { +static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) { server = s; avahi_log_debug("server state: %i", state); @@ -205,14 +205,14 @@ fail: } static void hnr_callback( - AvahiSHostNameResolver *r, + AVAHI_GCC_UNUSED AvahiSHostNameResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, const char *hostname, const AvahiAddress *a, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { char t[AVAHI_ADDRESS_STR_MAX]; if (a) @@ -222,14 +222,14 @@ static void hnr_callback( } static void ar_callback( - AvahiSAddressResolver *r, + AVAHI_GCC_UNUSED AvahiSAddressResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *a, const char *hostname, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { char t[AVAHI_ADDRESS_STR_MAX]; avahi_address_snprint(t, sizeof(t), a); @@ -238,45 +238,45 @@ static void ar_callback( } static void db_callback( - AvahiSDomainBrowser *b, + AVAHI_GCC_UNUSED AvahiSDomainBrowser *b, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("DB: (%i.%i) <%s> [%s]", iface, protocol, domain, browser_event_to_string(event)); } static void stb_callback( - AvahiSServiceTypeBrowser *b, + AVAHI_GCC_UNUSED AvahiSServiceTypeBrowser *b, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *service_type, const char *domain, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("STB: (%i.%i) %s in <%s> [%s]", iface, protocol, service_type, domain, browser_event_to_string(event)); } static void sb_callback( - AvahiSServiceBrowser *b, + AVAHI_GCC_UNUSED AvahiSServiceBrowser *b, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *service_type, const char *domain, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("SB: (%i.%i) <%s> as %s in <%s> [%s]", iface, protocol, name, service_type, domain, browser_event_to_string(event)); } static void sr_callback( - AvahiSServiceResolver *r, + AVAHI_GCC_UNUSED AvahiSServiceResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, @@ -287,8 +287,8 @@ static void sr_callback( const AvahiAddress *a, uint16_t port, AvahiStringList *txt, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { if (event != AVAHI_RESOLVER_FOUND) avahi_log_debug("SR: (%i.%i) <%s> as %s in <%s> [%s]", iface, protocol, name, service_type, domain_name, resolver_event_to_string(event)); @@ -304,15 +304,15 @@ static void sr_callback( } static void dsb_callback( - AvahiSDNSServerBrowser *b, + AVAHI_GCC_UNUSED AvahiSDNSServerBrowser *b, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const char*hostname, const AvahiAddress *a, uint16_t port, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { char t[AVAHI_ADDRESS_STR_MAX] = "n/a"; @@ -322,7 +322,7 @@ static void dsb_callback( avahi_log_debug("DSB: (%i.%i): %s/%s:%i [%s]", iface, protocol, hostname, t, port, browser_event_to_string(event)); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiSRecordBrowser *r; AvahiSHostNameResolver *hnr; AvahiSAddressResolver *ar; diff --git a/avahi-core/browse-dns-server.c b/avahi-core/browse-dns-server.c index ba0aeaa..48d23ad 100644 --- a/avahi-core/browse-dns-server.c +++ b/avahi-core/browse-dns-server.c @@ -96,8 +96,8 @@ static void server_info_free(AvahiSDNSServerBrowser *b, AvahiDNSServerInfo *i) { static void host_name_resolver_callback( AvahiSHostNameResolver *r, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *host_name, const AvahiAddress *a, diff --git a/avahi-core/browse.c b/avahi-core/browse.c index caf59e7..dd4fe3c 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -454,7 +454,7 @@ static void lookup_drop_cname(AvahiSRBLookup *l, AvahiIfIndex interface, AvahiPr } } -static void defer_callback(AvahiTimeEvent *e, void *userdata) { +static void defer_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *userdata) { AvahiSRecordBrowser *b = userdata; int n; diff --git a/avahi-core/conformance-test.c b/avahi-core/conformance-test.c index 4445fb5..6873b5c 100644 --- a/avahi-core/conformance-test.c +++ b/avahi-core/conformance-test.c @@ -47,11 +47,11 @@ static int try = 0; static AvahiServer *avahi = NULL; static const AvahiPoll *poll_api; -static void dump_line(const char *text, void* userdata) { +static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) { printf("%s\n", text); } -static void dump_timeout_callback(AvahiTimeout *timeout, void* data) { +static void dump_timeout_callback(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void* userdata) { struct timeval tv; avahi_server_dump(avahi, dump_line, NULL); @@ -82,7 +82,7 @@ static void create_service(const char *t) { try++; } -static void rename_timeout_callback(AvahiTimeout *timeout, void *userdata) { +static void rename_timeout_callback(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *userdata) { struct timeval tv; if (access("flag", F_OK) == 0) { @@ -94,7 +94,7 @@ static void rename_timeout_callback(AvahiTimeout *timeout, void *userdata) { poll_api->timeout_update(timeout, &tv); } -static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata) { +static void entry_group_callback(AVAHI_GCC_UNUSED AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void* userdata) { if (state == AVAHI_ENTRY_GROUP_COLLISION) create_service(NULL); else if (state == AVAHI_ENTRY_GROUP_ESTABLISHED) { @@ -103,7 +103,7 @@ static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntry } } -static void server_callback(AvahiServer *s, AvahiServerState state, void* userdata) { +static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("server state: %i", state); if (state == AVAHI_SERVER_RUNNING) { @@ -120,7 +120,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void* userda } } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { int error; AvahiSimplePoll *simple_poll; struct timeval tv; diff --git a/avahi-core/dns-test.c b/avahi-core/dns-test.c index 2336f42..5634ca5 100644 --- a/avahi-core/dns-test.c +++ b/avahi-core/dns-test.c @@ -35,7 +35,7 @@ #include "log.h" #include "util.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { char t[AVAHI_DOMAIN_NAME_MAX]; const char *a, *b, *c, *d; AvahiDnsPacket *p; diff --git a/avahi-core/entry.c b/avahi-core/entry.c index 1b6ab8b..fd0e233 100644 --- a/avahi-core/entry.c +++ b/avahi-core/entry.c @@ -1017,7 +1017,7 @@ static void entry_group_commit_real(AvahiSEntryGroup *g) { } } -static void entry_group_register_time_event_callback(AvahiTimeEvent *e, void* userdata) { +static void entry_group_register_time_event_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* userdata) { AvahiSEntryGroup *g = userdata; assert(g); diff --git a/avahi-core/hashmap-test.c b/avahi-core/hashmap-test.c index a57cf8b..9826d53 100644 --- a/avahi-core/hashmap-test.c +++ b/avahi-core/hashmap-test.c @@ -31,7 +31,7 @@ #include "hashmap.h" #include "util.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { unsigned n; AvahiHashmap *m; const char *t; diff --git a/avahi-core/netlink.c b/avahi-core/netlink.c index 554f25a..b2a6684 100644 --- a/avahi-core/netlink.c +++ b/avahi-core/netlink.c @@ -76,7 +76,7 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) { return 0; } -static void socket_event(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdata) { +static void socket_event(AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent event, void *userdata) { AvahiNetlink *nl = userdata; assert(w); diff --git a/avahi-core/prioq-test.c b/avahi-core/prioq-test.c index 0e43702..d85a222 100644 --- a/avahi-core/prioq-test.c +++ b/avahi-core/prioq-test.c @@ -28,6 +28,8 @@ #include #include +#include + #include "prioq.h" #define POINTER_TO_INT(p) ((int) (p)) @@ -80,7 +82,7 @@ static void rec(AvahiPrioQueueNode *n) { rec(n->right); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiPrioQueue *q, *q2; int i; diff --git a/avahi-core/probe-sched.c b/avahi-core/probe-sched.c index 7a302c3..cc2b2ec 100644 --- a/avahi-core/probe-sched.c +++ b/avahi-core/probe-sched.c @@ -214,7 +214,7 @@ static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, Ava return 1; } -static void elapse_callback(AvahiTimeEvent *e, void* data) { +static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) { AvahiProbeJob *pj = data, *next; AvahiProbeScheduler *s; AvahiDnsPacket *p; diff --git a/avahi-core/querier-test.c b/avahi-core/querier-test.c index 6ba33d0..1c28ea0 100644 --- a/avahi-core/querier-test.c +++ b/avahi-core/querier-test.c @@ -65,11 +65,11 @@ 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); @@ -77,11 +77,11 @@ static void create_second_service_browser(AvahiTimeout *timeout, void* userdata) 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; diff --git a/avahi-core/querier.c b/avahi-core/querier.c index a58d387..41acc24 100644 --- a/avahi-core/querier.c +++ b/avahi-core/querier.c @@ -58,7 +58,7 @@ void avahi_querier_free(AvahiQuerier *q) { avahi_free(q); } -static void querier_elapse_callback(AvahiTimeEvent *e, void *userdata) { +static void querier_elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *userdata) { AvahiQuerier *q = userdata; struct timeval tv; diff --git a/avahi-core/query-sched.c b/avahi-core/query-sched.c index d7d8ab0..0096838 100644 --- a/avahi-core/query-sched.c +++ b/avahi-core/query-sched.c @@ -254,7 +254,7 @@ static void append_known_answers_and_send(AvahiQueryScheduler *s, AvahiDnsPacket avahi_dns_packet_free(p); } -static void elapse_callback(AvahiTimeEvent *e, void* data) { +static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) { AvahiQueryJob *qj = data; AvahiQueryScheduler *s; AvahiDnsPacket *p; diff --git a/avahi-core/response-sched.c b/avahi-core/response-sched.c index 6883771..7ab5575 100644 --- a/avahi-core/response-sched.c +++ b/avahi-core/response-sched.c @@ -188,7 +188,7 @@ void avahi_response_scheduler_clear(AvahiResponseScheduler *s) { job_free(s, s->suppressed); } -static void enumerate_aux_records_callback(AvahiServer *s, AvahiRecord *r, int flush_cache, void* userdata) { +static void enumerate_aux_records_callback(AVAHI_GCC_UNUSED AvahiServer *s, AvahiRecord *r, int flush_cache, void* userdata) { AvahiResponseJob *rj = userdata; assert(r); @@ -265,7 +265,7 @@ static void send_response_packet(AvahiResponseScheduler *s, AvahiResponseJob *rj avahi_dns_packet_free(p); } -static void elapse_callback(AvahiTimeEvent *e, void* data) { +static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) { AvahiResponseJob *rj = data; assert(rj); diff --git a/avahi-core/server.c b/avahi-core/server.c index 7b0a56e..700b3a8 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1104,7 +1104,7 @@ void avahi_server_decrease_host_rr_pending(AvahiServer *s) { server_set_state(s, AVAHI_SERVER_RUNNING); } -void avahi_host_rr_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void *userdata) { +void avahi_host_rr_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) { assert(s); assert(g); diff --git a/avahi-core/timeeventq-test.c b/avahi-core/timeeventq-test.c index 46a948a..c66a55a 100644 --- a/avahi-core/timeeventq-test.c +++ b/avahi-core/timeeventq-test.c @@ -45,7 +45,7 @@ static void callback(AvahiTimeEvent*e, void* userdata) { avahi_time_event_update(e, &tv); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { struct timeval tv; AvahiSimplePoll *s; diff --git a/avahi-core/timeeventq.c b/avahi-core/timeeventq.c index e8782c9..17334ee 100644 --- a/avahi-core/timeeventq.c +++ b/avahi-core/timeeventq.c @@ -75,7 +75,7 @@ static void update_timeout(AvahiTimeEventQueue *q) { q->poll_api->timeout_update(q->timeout, NULL); } -static void expiration_event(AvahiTimeout *timeout, void *userdata) { +static void expiration_event(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void *userdata) { AvahiTimeEventQueue *q = userdata; AvahiTimeEvent *e; diff --git a/avahi-core/update-test.c b/avahi-core/update-test.c index fbfd51a..017397b 100644 --- a/avahi-core/update-test.c +++ b/avahi-core/update-test.c @@ -40,7 +40,7 @@ static AvahiSEntryGroup *group = NULL; -static void server_callback(AvahiServer *s, AvahiServerState state, void* userdata) { +static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) { avahi_log_debug("server state: %i", state); @@ -57,7 +57,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void* userda } } -static void modify_txt_callback(AvahiTimeout *e, void *userdata) { +static void modify_txt_callback(AVAHI_GCC_UNUSED AvahiTimeout *e, void *userdata) { int ret; AvahiServer *s = userdata; @@ -65,7 +65,7 @@ static void modify_txt_callback(AvahiTimeout *e, void *userdata) { assert(ret == AVAHI_OK); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiSimplePoll *simple_poll; const AvahiPoll *poll_api; AvahiServer *server; diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 51e192e..f191074 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -551,7 +551,7 @@ finish: } } -static void socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) { +static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata) { AvahiWideAreaLookupEngine *e = userdata; AvahiAddress a; AvahiDnsPacket *p = NULL; diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 0b1a6e8..8bb4a4d 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -627,7 +627,7 @@ fail: } -static DBusHandlerResult msg_signal_filter_impl(DBusConnection *c, DBusMessage *m, void *userdata) { +static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection *c, DBusMessage *m, void *userdata) { DBusError error; dbus_error_init(&error); @@ -1733,7 +1733,7 @@ fail: return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void *userdata) { +static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAHI_GCC_UNUSED void *userdata) { DBusError error; dbus_error_init(&error); @@ -2439,7 +2439,7 @@ void dbus_protocol_server_state_changed(AvahiServerState state) { else e = AVAHI_DBUS_ERR_OK; - dbus_message_append_args(m, DBUS_TYPE_INT32, &t, DBUS_TYPE_INVALID); + dbus_message_append_args(m, DBUS_TYPE_INT32, &t, DBUS_TYPE_STRING, &e, DBUS_TYPE_INVALID); dbus_connection_send(server->bus, m, NULL); dbus_message_unref(m); } diff --git a/avahi-daemon/ini-file-parser-test.c b/avahi-daemon/ini-file-parser-test.c index 5ef1ce6..47530b5 100644 --- a/avahi-daemon/ini-file-parser-test.c +++ b/avahi-daemon/ini-file-parser-test.c @@ -25,7 +25,7 @@ #include "ini-file-parser.h" -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiIniFile *f; AvahiIniFileGroup *g; diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index cf87e23..8d1a496 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -230,7 +230,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void *userda avahi_server = s; #ifdef HAVE_DBUS - if (c->enable_dbus) + if (c->enable_dbus && state != AVAHI_SERVER_INVALID && state != AVAHI_SERVER_FAILURE) dbus_protocol_server_state_changed(state); #endif @@ -556,11 +556,11 @@ static void log_function(AvahiLogLevel level, const char *txt) { daemon_log(log_level_map[level], "%s", txt); } -static void dump(const char *text, void* userdata) { +static void dump(const char *text, AVAHI_GCC_UNUSED void* userdata) { avahi_log_info("%s", text); } -static void signal_callback(AvahiWatch *watch, int fd, AvahiWatchEvent event, void *userdata) { +static void signal_callback(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AVAHI_GCC_UNUSED AvahiWatchEvent event, AVAHI_GCC_UNUSED void *userdata) { int sig; const AvahiPoll *poll_api; diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index 6c6f125..a3b48cc 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -167,13 +167,13 @@ static void client_output_printf(Client *c, const char *format, ...) { } static void host_name_resolver_callback( - AvahiSHostNameResolver *r, + AVAHI_GCC_UNUSED AvahiSHostNameResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, const char *hostname, const AvahiAddress *a, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -192,13 +192,13 @@ static void host_name_resolver_callback( } static void address_resolver_callback( - AvahiSAddressResolver *r, + AVAHI_GCC_UNUSED AvahiSAddressResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, - const AvahiAddress *a, + AVAHI_GCC_UNUSED const AvahiAddress *a, const char *hostname, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -214,14 +214,14 @@ static void address_resolver_callback( } static void dns_server_browser_callback( - AvahiSDNSServerBrowser *b, + AVAHI_GCC_UNUSED AvahiSDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, - const char *host_name, + AVAHI_GCC_UNUSED const char *host_name, const AvahiAddress *a, uint16_t port, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -370,7 +370,7 @@ static void handle_input(Client *c) { } } -static void client_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { +static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEvent events, void *userdata) { Client *c = userdata; assert(c); @@ -418,7 +418,7 @@ static void client_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void (c->inbuf_length < sizeof(c->inbuf) ? AVAHI_WATCH_IN : 0)); } -static void server_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { +static void server_work(AVAHI_GCC_UNUSED AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { Server *s = userdata; assert(s); diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c index 5eba8b2..129063c 100644 --- a/avahi-daemon/static-services.c +++ b/avahi-daemon/static-services.c @@ -175,7 +175,7 @@ static void static_service_group_free(StaticServiceGroup *g) { avahi_free(g); } -static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *eg, AvahiEntryGroupState state, void* userdata) { +static void entry_group_callback(AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGroup *eg, AvahiEntryGroupState state, void* userdata) { StaticServiceGroup *g = userdata; assert(s); @@ -402,7 +402,7 @@ invalid_attr: return; } -static void XMLCALL xml_end(void *data, const char *el) { +static void XMLCALL xml_end(void *data, AVAHI_GCC_UNUSED const char *el) { struct xml_userdata *u = data; assert(u); diff --git a/avahi-discover-standalone/main.c b/avahi-discover-standalone/main.c index 74dabd7..e77a007 100644 --- a/avahi-discover-standalone/main.c +++ b/avahi-discover-standalone/main.c @@ -125,15 +125,15 @@ static void free_service(struct Service *s) { } static void service_browser_callback( - AvahiSServiceBrowser *b, + AVAHI_GCC_UNUSED AvahiSServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *service_name, const char *service_type, const char *domain_name, - AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { if (event == AVAHI_BROWSER_NEW) { struct Service *s; @@ -177,14 +177,14 @@ static void service_browser_callback( } static void service_type_browser_callback( - AvahiSServiceTypeBrowser *b, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiSServiceTypeBrowser *b, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiBrowserEvent event, const char *service_type, const char *domain, - AvahiLookupResultFlags flags, - void * userdata) { + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void * userdata) { struct ServiceType *st; GtkTreePath *path; @@ -268,17 +268,17 @@ static struct Service *get_service_on_cursor(void) { static void service_resolver_callback( AvahiSServiceResolver *r, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, - const char *name, - const char *type, - const char *domain, + AVAHI_GCC_UNUSED const char *name, + AVAHI_GCC_UNUSED const char *type, + AVAHI_GCC_UNUSED const char *domain, const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { struct Service *s; @@ -299,7 +299,7 @@ static void service_resolver_callback( update_label(s, host_name, a, port, txt); } -static void tree_view_on_cursor_changed(GtkTreeView *tv, gpointer userdata) { +static void tree_view_on_cursor_changed(AVAHI_GCC_UNUSED GtkTreeView *tv, AVAHI_GCC_UNUSED gpointer userdata) { struct Service *s; if (!(s = get_service_on_cursor())) @@ -313,7 +313,7 @@ static void tree_view_on_cursor_changed(GtkTreeView *tv, gpointer userdata) { service_resolver = avahi_s_service_resolver_new(server, s->interface, s->protocol, s->service_name, s->service_type->service_type, s->domain_name, AVAHI_PROTO_UNSPEC, 0, service_resolver_callback, s); } -static gboolean main_window_on_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) { +static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget, AVAHI_GCC_UNUSED GdkEvent *event, AVAHI_GCC_UNUSED gpointer user_data) { gtk_main_quit(); return FALSE; } diff --git a/avahi-glib/glib-watch-test.c b/avahi-glib/glib-watch-test.c index 73114d1..733c81f 100644 --- a/avahi-glib/glib-watch-test.c +++ b/avahi-glib/glib-watch-test.c @@ -31,12 +31,14 @@ #include #include +#include + #include "glib-watch.h" static const AvahiPoll *api = NULL; static GMainLoop *loop = 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; @@ -52,7 +54,7 @@ static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdat } } -static void wakeup(AvahiTimeout *t, void *userdata) { +static void wakeup(AvahiTimeout *t, AVAHI_GCC_UNUSED void *userdata) { struct timeval tv; static int i = 0; @@ -65,7 +67,7 @@ static void wakeup(AvahiTimeout *t, void *userdata) { api->timeout_update(t, &tv); } -int main(int argc, char *argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiGLibPoll *g; struct timeval tv; diff --git a/avahi-glib/glib-watch.c b/avahi-glib/glib-watch.c index a99cb4d..9d80440 100644 --- a/avahi-glib/glib-watch.c +++ b/avahi-glib/glib-watch.c @@ -300,7 +300,7 @@ static gboolean check_func(GSource *source) { return FALSE; } -static gboolean dispatch_func(GSource *source, GSourceFunc callback, gpointer userdata) { +static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc callback, AVAHI_GCC_UNUSED gpointer userdata) { AvahiGLibPoll* g = (AvahiGLibPoll*) source; AvahiWatch *w; AvahiTimeout *next_timeout; diff --git a/avahi-utils/Makefile.am b/avahi-utils/Makefile.am index 1e10f25..0c5b711 100644 --- a/avahi-utils/Makefile.am +++ b/avahi-utils/Makefile.am @@ -20,7 +20,6 @@ EXTRA_DIST = \ avahi-publish-address.in \ avahi-publish-service.in \ - avahi-browse.in \ avahi-bookmarks.in \ avahi-resolve-host-name.in \ avahi-resolve-address.in \ @@ -36,7 +35,6 @@ if HAVE_PYGTK pythonscripts = \ avahi-publish-address \ avahi-publish-service \ - avahi-browse \ avahi-bookmarks \ avahi-resolve-host-name \ avahi-resolve-address \ @@ -62,10 +60,6 @@ avahi-publish-service: avahi-publish-service.in sed -e 's,@PYTHON\@,$(PYTHON),g' $< > $@ chmod +x $@ -avahi-browse: avahi-browse.in - sed -e 's,@PYTHON\@,$(PYTHON),g' $< > $@ - chmod +x $@ - avahi-bookmarks: avahi-bookmarks.in sed -e 's,@PYTHON\@,$(PYTHON),g' $< > $@ chmod +x $@ @@ -84,3 +78,13 @@ CLEANFILES = $(pythonscripts) $(desktop_DATA) endif endif endif + +if HAVE_DBUS + +bin_PROGRAMS = avahi-browse + +avahi_browse_SOURCES = avahi-browse.c sigint.c +avahi_browse_CFLAGS = $(AM_CFLAGS) +avahi_browse_LDADD = $(AM_LDADD) ../avahi-client/libavahi-client.la ../avahi-common/libavahi-common.la + +endif diff --git a/avahi-utils/avahi-browse.in b/avahi-utils/avahi-browse.in deleted file mode 100755 index 1dd3376..0000000 --- a/avahi-utils/avahi-browse.in +++ /dev/null @@ -1,166 +0,0 @@ -#!@PYTHON@ -# -*-python-*- -# $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 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 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 -# USA. - -import sys, getopt - -try: - import avahi, gobject, dbus, avahi.ServiceTypeDatabase -except ImportError: - print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." - sys.exit(1) - -try: - import dbus.glib -except ImportError, e: - pass - -def usage(retval = 0): - print "%s [options] \n" % sys.argv[0] - print " -h --help Show this help" - print " -d --domain The domain to browse" - print " -a --all Show all services, regardless of the type" - sys.exit(retval) - -try: - opts, args = getopt.getopt(sys.argv[1:], "hd:a", ["help", "domain=", "all"]) -except getopt.GetoptError: - usage(2) - -domain = None -stype = None -show_all = False - -for o, a in opts: - if o in ("-h", "--help"): - usage() - - if o in ("-d", "--domain"): - domain = a - - if o in ("-a", "--all"): - show_all = True - -if len(args) > 1: - usage(2) - -if len(args) >= 1: - stype = args[0]; - -if stype is None and not show_all: - usage(2) - -service_type_browsers = {} -service_browsers = {} - -service_type_db = avahi.ServiceTypeDatabase.ServiceTypeDatabase() - -def siocgifname(interface): - global server - - if interface <= 0: - return "any" - else: - return server.GetNetworkInterfaceNameByIndex(interface) - -def lookup_service_type(stype): - global service_type_db - - try: - return service_type_db[stype] - except KeyError: - return "n/a" - -def service_resolved(interface, protocol, name, stype, domain, host, aprotocol, address, port, txt, flags): - print "Service data for service '%s' of type '%s' (%s) in domain '%s' on %s.%i:" % (name, stype, lookup_service_type(stype), domain, siocgifname(interface), protocol) - print "\tHost %s (%s), port %i, TXT data: %s" % (host, address, port, avahi.txt_array_to_string_array(txt)) - -def print_error(err): - print "Error:", str(err) - -def new_service(interface, protocol, name, stype, domain, flags): - global server - - print "Found service '%s' of type '%s' (%s) in domain '%s' on %s.%i." % (name, stype, lookup_service_type(stype), domain, siocgifname(interface), protocol) - - # Asynchronous resolving - server.ResolveService(interface, protocol, name, stype, domain, avahi.PROTO_UNSPEC, dbus.UInt32(0), reply_handler=service_resolved, error_handler=print_error) - -def remove_service(interface, protocol, name, stype, domain, flags): - print "Service '%s' of type '%s' (%s) in domain '%s' on %s.%i disappeared." % (name, stype, lookup_service_type(stype), domain, siocgifname(interface), protocol) - -def new_service_type(interface, protocol, stype, domain, flags): - global server, service_browsers - - # Are we already browsing this domain for this type? - if service_browsers.has_key((interface, protocol, stype, domain)): - return - - print "Browsing for services of type '%s' (%s) in domain '%s' on %s.%i ..." % (stype, lookup_service_type(stype), domain, siocgifname(interface), protocol) - - b = dbus.Interface(bus.get_object(avahi.DBUS_NAME, server.ServiceBrowserNew(interface, protocol, stype, domain, dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_BROWSER) - b.connect_to_signal('ItemNew', new_service) - b.connect_to_signal('ItemRemove', remove_service) - - service_browsers[(interface, protocol, stype, domain)] = b - -def browse_domain(interface, protocol, domain): - global server, service_type_browsers, stype - - # Are we already browsing this domain? - if service_type_browsers.has_key((interface, protocol, domain)): - return - - if stype is None: - print "Browsing domain '%s' on %s.%i ..." % (domain, siocgifname(interface), protocol) - - b = dbus.Interface(bus.get_object(avahi.DBUS_NAME, server.ServiceTypeBrowserNew(interface, protocol, domain, dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_TYPE_BROWSER) - b.connect_to_signal('ItemNew', new_service_type) - - service_type_browsers[(interface, protocol, domain)] = b - else: - new_service_type(interface, protocol, stype, domain, dbus.UInt32(0)) - -def new_domain(interface, protocol, domain, flags): - - # We browse for .local anyway... - if domain != "local": - browse_domain(interface, protocol, domain) - - -bus = dbus.SystemBus() -server = dbus.Interface(bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER) - -if domain is None: - # Explicitly browse .local - browse_domain(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "local") - - # Browse for other browsable domains - db = dbus.Interface(bus.get_object(avahi.DBUS_NAME, server.DomainBrowserNew(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "", avahi.DOMAIN_BROWSER_BROWSE, dbus.UInt32(0))), avahi.DBUS_INTERFACE_DOMAIN_BROWSER) - db.connect_to_signal('ItemNew', new_domain) - -else: - # Just browse the domain the user wants us to browse - browse_domain(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, domain) - -try: - gobject.MainLoop().run() -except KeyboardInterrupt, k: - pass diff --git a/configure.ac b/configure.ac index 06b86f7..91deb74 100644 --- a/configure.ac +++ b/configure.ac @@ -155,7 +155,7 @@ test_gcc_flag() { # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then - DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" + DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline" if test "x$HAVE_NETLINK" = "xyes" ; then # Test whether rtnetlink.h can be included when compiled with -std=c99 diff --git a/docs/TODO b/docs/TODO index 6e93f89..c826563 100644 --- a/docs/TODO +++ b/docs/TODO @@ -4,6 +4,7 @@ for 0.6: * Add static host configuration like static services [lathiat] * wrap avahi_server_add_record() via DBUS and in avahi-client [lathiat] * always set source address for outgoing packets +* introduce AVAHI_CLIENT_FAILURE later: * add simplification routine for adding services diff --git a/examples/Makefile.am b/examples/Makefile.am index 92cdccd..e6e66f5 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -33,7 +33,6 @@ core_browse_services_SOURCES = core-browse-services.c core_browse_services_CFLAGS = $(AM_CFLAGS) core_browse_services_LDADD = $(AM_LDADD) ../avahi-core/libavahi-core.la ../avahi-common/libavahi-common.la - if HAVE_DBUS if ENABLE_TESTS diff --git a/examples/client-browse-services.c b/examples/client-browse-services.c index 5ebbf2d..c5a1cbd 100644 --- a/examples/client-browse-services.c +++ b/examples/client-browse-services.c @@ -39,8 +39,8 @@ static AvahiSimplePoll *simple_poll = NULL; static void resolve_callback( AvahiServiceResolver *r, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, @@ -50,7 +50,7 @@ static void resolve_callback( uint16_t port, AvahiStringList *txt, AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED void* userdata) { assert(r); @@ -101,7 +101,7 @@ static void browse_callback( const char *name, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { AvahiClient *c = userdata; @@ -137,11 +137,10 @@ static void browse_callback( case AVAHI_BROWSER_CACHE_EXHAUSTED: fprintf(stderr, "(Browser) %s\n", event == AVAHI_BROWSER_CACHE_EXHAUSTED ? "CACHE_EXHAUSTED" : "ALL_FOR_NOW"); break; - } } -static void client_callback(AvahiClient *c, AvahiClientState state, void * userdata) { +static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) { assert(c); /* Called whenever the client or server state changes */ @@ -152,7 +151,7 @@ static void client_callback(AvahiClient *c, AvahiClientState state, void * userd } } -int main(int argc, char*argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { AvahiClient *client = NULL; AvahiServiceBrowser *sb = NULL; int error; diff --git a/examples/client-publish-service.c b/examples/client-publish-service.c index d99c46b..7013156 100644 --- a/examples/client-publish-service.c +++ b/examples/client-publish-service.c @@ -42,7 +42,7 @@ static char *name = NULL; static void create_services(AvahiClient *c); -static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { +static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) { assert(g == group); /* Called whenever the entry group state changes */ @@ -127,7 +127,7 @@ fail: avahi_simple_poll_quit(simple_poll); } -static void client_callback(AvahiClient *c, AvahiClientState state, void * userdata) { +static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) { assert(c); /* Called whenever the client or server state changes */ @@ -157,14 +157,12 @@ static void client_callback(AvahiClient *c, AvahiClientState state, void * userd break; - case AVAHI_CLIENT_S_FAILURE: - case AVAHI_CLIENT_S_INVALID: case AVAHI_CLIENT_S_REGISTERING: ; } } -int main(int argc, char*argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { AvahiClient *client = NULL; int error; int ret = 1; diff --git a/examples/core-browse-services.c b/examples/core-browse-services.c index db2dcb9..a34281e 100644 --- a/examples/core-browse-services.c +++ b/examples/core-browse-services.c @@ -50,8 +50,8 @@ static AvahiServer *server = NULL; static void resolve_callback( AvahiSServiceResolver *r, - AvahiIfIndex interface, - AvahiProtocol protocol, + AVAHI_GCC_UNUSED AvahiIfIndex interface, + AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, @@ -61,7 +61,7 @@ static void resolve_callback( uint16_t port, AvahiStringList *txt, AvahiLookupResultFlags flags, - void* userdata) { + AVAHI_GCC_UNUSED void* userdata) { assert(r); @@ -109,7 +109,7 @@ static void browse_callback( const char *name, const char *type, const char *domain, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { AvahiServer *s = userdata; @@ -149,7 +149,7 @@ static void browse_callback( } } -int main(int argc, char*argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { AvahiServerConfig config; AvahiSServiceBrowser *sb = NULL; int error; diff --git a/examples/core-publish-service.c b/examples/core-publish-service.c index f5cadea..65dfe5d 100644 --- a/examples/core-publish-service.c +++ b/examples/core-publish-service.c @@ -41,7 +41,7 @@ static char *name = NULL; static void create_services(AvahiServer *s); -static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void *userdata) { +static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) { assert(s); assert(g == group); @@ -129,7 +129,7 @@ fail: avahi_simple_poll_quit(simple_poll); } -static void server_callback(AvahiServer *s, AvahiServerState state, void * userdata) { +static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void * userdata) { assert(s); /* Called whenever the server state changes */ @@ -185,7 +185,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void * userd } } -int main(int argc, char*argv[]) { +int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { AvahiServerConfig config; AvahiServer *server = NULL; int error; diff --git a/examples/glib-integration.c b/examples/glib-integration.c index 8957128..bf6eacf 100644 --- a/examples/glib-integration.c +++ b/examples/glib-integration.c @@ -33,7 +33,7 @@ /* Callback for Avahi API Timeout Event */ static void -avahi_timeout_event (AvahiTimeout *timeout, void *userdata) +avahi_timeout_event (AVAHI_GCC_UNUSED AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *userdata) { g_message ("Avahi API Timeout reached!"); } @@ -54,7 +54,7 @@ avahi_timeout_event_glib (void *userdata) /* Callback for state changes on the Client */ static void -avahi_client_callback (AvahiClient *client, AvahiClientState state, void *userdata) +avahi_client_callback (AVAHI_GCC_UNUSED AvahiClient *client, AvahiClientState state, void *userdata) { GMainLoop *loop = userdata; @@ -71,7 +71,7 @@ avahi_client_callback (AvahiClient *client, AvahiClientState state, void *userda } int -main (int argc, char *argv[]) +main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { GMainLoop *loop = NULL; const AvahiPoll *poll_api; -- 2.39.5