From 77dc1cb05c8e6d23bd9cea37d4b4644cd76f0f82 Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sun, 14 Aug 2005 11:50:14 +0000 Subject: * Implement free functions for the various browsers in the C api git-svn-id: file:///home/lennart/svn/public/avahi/trunk@319 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/browser.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'avahi-client/browser.c') diff --git a/avahi-client/browser.c b/avahi-client/browser.c index bcd9914..6e0ed5d 100644 --- a/avahi-client/browser.c +++ b/avahi-client/browser.c @@ -88,6 +88,27 @@ dbus_error: return NULL; } +void +avahi_domain_browser_free (AvahiDomainBrowser *b) +{ + DBusMessage *message = NULL; + + if (b == NULL || b->path == NULL) + return; + + message = dbus_message_new_method_call (AVAHI_DBUS_NAME, + b->path, + AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, "Free"); + + dbus_connection_send (b->client->bus, message, NULL); + + AVAHI_LLIST_REMOVE(AvahiDomainBrowser, domain_browsers, b->client->domain_browsers, b); + + free (b); + + return; +} + char* avahi_domain_browser_path (AvahiDomainBrowser *b) { @@ -186,6 +207,27 @@ dbus_error: return NULL; } +void +avahi_service_type_browser_free (AvahiServiceTypeBrowser *b) +{ + DBusMessage *message = NULL; + + if (b == NULL || b->path == NULL) + return; + + message = dbus_message_new_method_call (AVAHI_DBUS_NAME, + b->path, + AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, "Free"); + + dbus_connection_send (b->client->bus, message, NULL); + + AVAHI_LLIST_REMOVE(AvahiServiceTypeBrowser, service_type_browsers, b->client->service_type_browsers, b); + + free (b); + + return; +} + char* avahi_service_type_browser_path (AvahiServiceTypeBrowser *b) { @@ -291,6 +333,29 @@ dbus_error: return NULL; } + +void +avahi_service_browser_free (AvahiServiceBrowser *b) +{ + DBusMessage *message = NULL; + + if (b == NULL || b->path == NULL) + return; + + printf ("Freeing %s\n", b->path); + + message = dbus_message_new_method_call (AVAHI_DBUS_NAME, + b->path, + AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, "Free"); + + dbus_connection_send (b->client->bus, message, NULL); + + AVAHI_LLIST_REMOVE(AvahiServiceBrowser, service_browsers, b->client->service_browsers, b); + + free (b); + + return; +} char* avahi_service_browser_path (AvahiServiceBrowser *b) -- cgit