From 769c00f228ba0d37217aaf1424dedde390e7a01c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 14 Aug 2005 22:11:35 +0000 Subject: * add new priority parameter to avahi_glib_poll_new() * beef up AvahiPoll a little to contain real timeout events * cleanups in avahi-client * drop glib dependency * port to AvahiPoll system * put some "const"s and "static"s in to make gcc shut up * change all uses of malloc/free to avahi_malloc/avahi_new/avahi_free git-svn-id: file:///home/lennart/svn/public/avahi/trunk@324 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/browser.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'avahi-client/browser.c') diff --git a/avahi-client/browser.c b/avahi-client/browser.c index a20b5d2..e994d2a 100644 --- a/avahi-client/browser.c +++ b/avahi-client/browser.c @@ -23,10 +23,6 @@ #include #endif -#include -#include -#include -#include #include #include #include @@ -34,14 +30,18 @@ #include #include -#include +#include +#include +#include +#include +#include #include "client.h" #include "internal.h" /* AvahiDomainBrowser */ -AvahiDomainBrowser* avahi_domain_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, char *domain, AvahiDomainBrowserType btype, AvahiDomainBrowserCallback callback, void *user_data) +AvahiDomainBrowser* avahi_domain_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *domain, AvahiDomainBrowserType btype, AvahiDomainBrowserCallback callback, void *user_data) { AvahiDomainBrowser *tmp = NULL; DBusMessage *message = NULL, *reply; @@ -70,7 +70,7 @@ AvahiDomainBrowser* avahi_domain_browser_new (AvahiClient *client, AvahiIfIndex if (dbus_error_is_set (&error) || path == NULL) goto dbus_error; - tmp = malloc (sizeof (AvahiDomainBrowser)); + tmp = avahi_new (AvahiDomainBrowser, 1); tmp->client = client; tmp->callback = callback; tmp->user_data = user_data; @@ -107,12 +107,12 @@ avahi_domain_browser_free (AvahiDomainBrowser *b) AVAHI_LLIST_REMOVE(AvahiDomainBrowser, domain_browsers, client->domain_browsers, b); - free (b); + avahi_free (b); return avahi_client_set_errno (client, AVAHI_OK); } -char* +const char* avahi_domain_browser_path (AvahiDomainBrowser *b) { return b->path; @@ -161,7 +161,7 @@ out: } /* AvahiServiceTypeBrowser */ -AvahiServiceTypeBrowser* avahi_service_type_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, char *domain, AvahiServiceTypeBrowserCallback callback, void *user_data) +AvahiServiceTypeBrowser* avahi_service_type_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *domain, AvahiServiceTypeBrowserCallback callback, void *user_data) { AvahiServiceTypeBrowser *tmp = NULL; DBusMessage *message = NULL, *reply; @@ -192,7 +192,7 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new (AvahiClient *client, Av if (dbus_error_is_set (&error) || path == NULL) goto dbus_error; - tmp = malloc (sizeof (AvahiServiceTypeBrowser)); + tmp = avahi_new(AvahiServiceTypeBrowser, 1); tmp->client = client; tmp->callback = callback; tmp->user_data = user_data; @@ -229,12 +229,12 @@ avahi_service_type_browser_free (AvahiServiceTypeBrowser *b) AVAHI_LLIST_REMOVE(AvahiServiceTypeBrowser, service_type_browsers, b->client->service_type_browsers, b); - free (b); + avahi_free (b); return avahi_client_set_errno (client, AVAHI_OK); } -char* +const char* avahi_service_type_browser_path (AvahiServiceTypeBrowser *b) { return b->path; @@ -288,7 +288,7 @@ out: /* AvahiServiceBrowser */ -AvahiServiceBrowser* avahi_service_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, char *type, char *domain, AvahiServiceBrowserCallback callback, void *user_data) +AvahiServiceBrowser* avahi_service_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *type, const char *domain, AvahiServiceBrowserCallback callback, void *user_data) { AvahiServiceBrowser *tmp = NULL; DBusMessage *message = NULL, *reply; @@ -322,7 +322,7 @@ AvahiServiceBrowser* avahi_service_browser_new (AvahiClient *client, AvahiIfInde if (dbus_error_is_set (&error) || path == NULL) goto dbus_error; - tmp = malloc (sizeof (AvahiServiceBrowser)); + tmp = avahi_new(AvahiServiceBrowser, 1); tmp->client = client; tmp->callback = callback; tmp->user_data = user_data; @@ -359,12 +359,12 @@ avahi_service_browser_free (AvahiServiceBrowser *b) AVAHI_LLIST_REMOVE(AvahiServiceBrowser, service_browsers, b->client->service_browsers, b); - free (b); + avahi_free (b); return avahi_client_set_errno (client, AVAHI_OK); } -char* +const char* avahi_service_browser_path (AvahiServiceBrowser *b) { return b->path; -- cgit