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/entrygroup.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'avahi-client/entrygroup.c') diff --git a/avahi-client/entrygroup.c b/avahi-client/entrygroup.c index 93c3fd6..6335755 100644 --- a/avahi-client/entrygroup.c +++ b/avahi-client/entrygroup.c @@ -23,18 +23,17 @@ #include #endif -#include -#include -#include -#include #include #include #include #include -#include -#include +#include +#include +#include +#include +#include #include "client.h" #include "internal.h" @@ -88,11 +87,11 @@ avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCallback callback, vo goto fail; } - tmp = malloc (sizeof (AvahiEntryGroup)); + tmp = avahi_new(AvahiEntryGroup, 1); tmp->client = client; - tmp->path = strdup (path); + tmp->path = avahi_strdup (path); tmp->callback = callback; tmp->user_data = user_data; @@ -104,7 +103,7 @@ avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCallback callback, vo return tmp; fail: - if (tmp) free (tmp); + if (tmp) avahi_free (tmp); if (message) dbus_message_unref (message); return NULL; } @@ -128,7 +127,7 @@ avahi_entry_group_free (AvahiEntryGroup *group) AVAHI_LLIST_REMOVE(AvahiEntryGroup, groups, client->groups, group); - free (group); + avahi_free (group); return avahi_client_set_errno (client, AVAHI_OK); } @@ -252,7 +251,7 @@ avahi_entry_group_add_service (AvahiEntryGroup *group, /* Assemble the AvahiStringList into an Array of Array of Bytes to send over dbus */ for (p = txt; p != NULL; p = p->next) { DBusMessageIter sub2; - const guint8 *data = p->text; + const uint8_t *data = p->text; dbus_message_iter_open_container(&sub, DBUS_TYPE_ARRAY, "y", &sub2); dbus_message_iter_append_fixed_array(&sub2, DBUS_TYPE_BYTE, &data, p->size); @@ -267,7 +266,7 @@ avahi_entry_group_add_service (AvahiEntryGroup *group, } /* XXX: debug function */ -char* avahi_entry_group_path (AvahiEntryGroup *group) +const char* avahi_entry_group_path (AvahiEntryGroup *group) { if (group != NULL) return group->path; else return NULL; -- cgit