From 3a625af272ee8c6f878ba4d44ed1c741a1582395 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 Aug 2005 21:07:02 +0000 Subject: * add C examples * change doxygen to output stuff in "doxygen/" instead of "doxygen-doc/" * implement avahi_entry_group_{reset,is_empty}() and make everyone use it * move holdoff (SLEEPING) time checking from server to entry group * add preliminary error codes git-svn-id: file:///home/lennart/svn/public/avahi/trunk@216 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/dbus-protocol.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'avahi-daemon/dbus-protocol.c') diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 0813617..c6a60df 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -513,6 +513,35 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, avahi_entry_group_commit(i->entry_group); return respond_ok(c, m); + + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Reset")) { + + if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) { + avahi_log_warn("Error parsing EntryGroup::Reset message"); + goto fail; + } + + avahi_entry_group_reset(i->entry_group); + return respond_ok(c, m); + + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) { + DBusMessage *reply; + gboolean b; + + if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) { + avahi_log_warn("Error parsing EntryGroup::IsEmpty message"); + goto fail; + } + + b = avahi_entry_group_is_empty(i->entry_group); + + reply = dbus_message_new_method_return(m); + dbus_message_append_args(m, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID); + dbus_connection_send(c, reply, NULL); + dbus_message_unref(reply); + + return DBUS_HANDLER_RESULT_HANDLED; + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState")) { DBusMessage *reply; gint32 t; -- cgit