From: Lennart Poettering Date: Wed, 27 Jul 2005 23:13:52 +0000 (+0000) Subject: * swap order of "type" and "name" arguments of avahi_server_add_service() and friends X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=8f1c6544deb351d9df51114c7f6e5f25e026f73e;p=catta * swap order of "type" and "name" arguments of avahi_server_add_service() and friends git-svn-id: file:///home/lennart/svn/public/avahi/trunk@179 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/avahi-test.c b/avahi-core/avahi-test.c index 61d3ea1..669ca5b 100644 --- a/avahi-core/avahi-test.c +++ b/avahi-core/avahi-test.c @@ -115,17 +115,17 @@ static void create_entries(gboolean new_name) { service_name = n; } - if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) { + if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) { avahi_log_error("Failed to add HTTP service"); goto fail; } - if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_ftp._tcp", service_name, NULL, NULL, 21, "foo", NULL) < 0) { + if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) < 0) { avahi_log_error("Failed to add FTP service"); goto fail; } - if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_webdav._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) { + if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) < 0) { avahi_log_error("Failed to add WEBDAV service"); goto fail; } diff --git a/avahi-core/conformance-test.c b/avahi-core/conformance-test.c index 688daba..e830982 100644 --- a/avahi-core/conformance-test.c +++ b/avahi-core/conformance-test.c @@ -62,7 +62,7 @@ static void create_service(gchar *t) { sleep(2); /* ugly ugly ugly hack */ group = avahi_entry_group_new(avahi, entry_group_callback, NULL); - avahi_server_add_service(avahi, group, 0, AF_UNSPEC, "_http._tcp", name, NULL, NULL, 80, "foo", NULL); + avahi_server_add_service(avahi, group, 0, AF_UNSPEC, name, "_http._tcp", NULL, NULL, 80, "foo", NULL); avahi_entry_group_commit(group); try++; diff --git a/avahi-core/core.h b/avahi-core/core.h index e7e6268..a41aee6 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -280,8 +280,8 @@ gint avahi_server_add_service( AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, - const gchar *type, /**< DNS-SD type, e.g. "_http._tcp" */ const gchar *name, /**< Service name, e.g. "Lennart's Files" */ + const gchar *type, /**< DNS-SD type, e.g. "_http._tcp" */ const gchar *domain, const gchar *host, /**< Host name where this servcie resides, or NULL if on the local host */ guint16 port, /**< Port number of the service */ @@ -293,8 +293,8 @@ gint avahi_server_add_service_va( AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, - const gchar *type, const gchar *name, + const gchar *type, const gchar *domain, const gchar *host, guint16 port, @@ -306,8 +306,8 @@ gint avahi_server_add_service_strlst( AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, - const gchar *type, const gchar *name, + const gchar *type, const gchar *domain, const gchar *host, guint16 port, diff --git a/avahi-core/iface.c b/avahi-core/iface.c index a4c7de8..070ef6a 100644 --- a/avahi-core/iface.c +++ b/avahi-core/iface.c @@ -102,7 +102,7 @@ static void update_hw_interface_rr(AvahiInterfaceMonitor *m, AvahiHwInterface *h g_free(t); hw->entry_group = avahi_entry_group_new(m->server, avahi_host_rr_entry_group_callback, NULL); - if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, "_workstation._tcp", name, NULL, NULL, 9, NULL) < 0) { + if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, name, "_workstation._tcp", NULL, NULL, 9, NULL) < 0) { avahi_log_warn(__FILE__": avahi_server_add_service() failed."); avahi_entry_group_free(hw->entry_group); hw->entry_group = NULL; diff --git a/avahi-core/server.c b/avahi-core/server.c index b3ae039..9619ab4 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1709,8 +1709,8 @@ gint avahi_server_add_service_strlst( AvahiEntryGroup *g, gint interface, guchar protocol, - const gchar *type, const gchar *name, + const gchar *type, const gchar *domain, const gchar *host, guint16 port, @@ -1761,8 +1761,8 @@ gint avahi_server_add_service_va( AvahiEntryGroup *g, gint interface, guchar protocol, - const gchar *type, const gchar *name, + const gchar *type, const gchar *domain, const gchar *host, guint16 port, @@ -1772,7 +1772,7 @@ gint avahi_server_add_service_va( g_assert(type); g_assert(name); - return avahi_server_add_service_strlst(s, g, interface, protocol, type, name, domain, host, port, avahi_string_list_new_va(va)); + return avahi_server_add_service_strlst(s, g, interface, protocol, name, type, domain, host, port, avahi_string_list_new_va(va)); } gint avahi_server_add_service( @@ -1780,8 +1780,8 @@ gint avahi_server_add_service( AvahiEntryGroup *g, gint interface, guchar protocol, - const gchar *type, const gchar *name, + const gchar *type, const gchar *domain, const gchar *host, guint16 port, @@ -1795,7 +1795,7 @@ gint avahi_server_add_service( g_assert(name); va_start(va, port); - ret = avahi_server_add_service_va(s, g, interface, protocol, type, name, domain, host, port, va); + ret = avahi_server_add_service_va(s, g, interface, protocol, name, type, domain, host, port, va); va_end(va); return ret; } diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index f0a1a2d..7be5ee0 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -326,8 +326,8 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, m, &error, DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, - DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &name, + DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, DBUS_TYPE_STRING, &host, DBUS_TYPE_UINT16, &port, @@ -346,7 +346,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, if (host && !*host) host = NULL; - if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, type, name, domain, host, port, strlst) < 0) { + if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, type, domain, host, port, strlst) < 0) { avahi_log_warn("Failed to add service: %s", name); return respond_error(c, m, "org.freedesktop.Avahi.InvalidServiceError", NULL); } else diff --git a/avahi-daemon/dbus-test.py b/avahi-daemon/dbus-test.py index cd708c0..c75faf3 100755 --- a/avahi-daemon/dbus-test.py +++ b/avahi-daemon/dbus-test.py @@ -34,7 +34,7 @@ def entry_group_state_changed_callback(t): g.connect_to_signal('StateChanged', entry_group_state_changed_callback) -g.AddService(0, 0, "_http._tcp", "foo", "", "", dbus.UInt16(4712), ["fuck=hallo", "gurke=mega"]) +g.AddService(0, 0, "Test Web Site", "_http._tcp", "", "", dbus.UInt16(4712), ["fuck=hallo", "gurke=mega"]) g.AddAddress(0, 0, "foo.local", "47.11.8.15") g.Commit() diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c index 4e97299..59ef7aa 100644 --- a/avahi-daemon/static-services.c +++ b/avahi-daemon/static-services.c @@ -210,7 +210,7 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) { avahi_server, g->entry_group, -1, AF_UNSPEC, - s->type, g->chosen_name, + g->chosen_name, s->type, s->domain_name, s->host_name, s->port, avahi_string_list_copy(s->txt_records)) < 0) { avahi_log_error("Failed to add service '%s' of type '%s', ignoring service group (%s)", g->chosen_name, s->type, g->filename);