diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-14 22:11:35 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-14 22:11:35 +0000 |
commit | 769c00f228ba0d37217aaf1424dedde390e7a01c (patch) | |
tree | e641d94f918a133f59e0eeb8e07109247d4d7aab /avahi-client/entrygroup.c | |
parent | a4acfaf4f942f702606e660990c873c9ff5b0395 (diff) |
* 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
Diffstat (limited to 'avahi-client/entrygroup.c')
-rw-r--r-- | avahi-client/entrygroup.c | 23 |
1 files changed, 11 insertions, 12 deletions
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 <config.h> #endif -#include <avahi-client/client.h> -#include <avahi-common/dbus.h> -#include <avahi-common/llist.h> -#include <avahi-common/error.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <dbus/dbus.h> -#include <dbus/dbus-glib-lowlevel.h> -#include <stdlib.h> +#include <avahi-client/client.h> +#include <avahi-common/dbus.h> +#include <avahi-common/llist.h> +#include <avahi-common/error.h> +#include <avahi-common/malloc.h> #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; |