From 3d2e63d2c5c351dde38b24a45a679ce819ed0e41 Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sun, 14 Aug 2005 12:06:09 +0000 Subject: * Add a free function for AvahiEntryGroup in C api * Modify the browser free functions to return/set errors. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@320 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/entrygroup.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'avahi-client/entrygroup.c') diff --git a/avahi-client/entrygroup.c b/avahi-client/entrygroup.c index ea56ee2..8120e49 100644 --- a/avahi-client/entrygroup.c +++ b/avahi-client/entrygroup.c @@ -113,6 +113,28 @@ fail: return NULL; } +int +avahi_entry_group_free (AvahiEntryGroup *group) +{ + AvahiClient *client = group->client; + DBusMessage *message; + + if (group == NULL || group->path == NULL) + return avahi_client_set_errno (client, AVAHI_ERR_INVALID_OBJECT); + + message = dbus_message_new_method_call (AVAHI_DBUS_NAME, + group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Free"); + + if (message == NULL) + return avahi_client_set_errno (client, AVAHI_ERR_DBUS_ERROR); + + dbus_connection_send (client->bus, message, NULL); + + free (group); + + return avahi_client_set_errno (client, AVAHI_OK); +} + int avahi_entry_group_commit (AvahiEntryGroup *group) { -- cgit