+handle_dbus (DBusConnection *bus,
+ DBusMessage *message,
+ const gchar *iface,
+ const gchar *member,
+ const gchar *pathstr)
+{
+ static int id = 1;
+ char *id_str = (char *) g_malloc(40);
+ DBusMessage *reply;
+
+ if (strcmp (iface, DBUS_INTERFACE_DBUS) != 0 ||
+ strcmp (member, "Hello") != 0)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+ /* TODO: Fix this hack (we don't handle wrap-around, for instance) */
+ sprintf (id_str, ":1.%d", id++);
+ reply = dbus_message_new_method_return (message);
+ dbus_message_append_args (reply, DBUS_TYPE_STRING, &id_str, DBUS_TYPE_INVALID);
+ dbus_connection_send (bus, reply, NULL);
+ dbus_connection_flush (bus);
+ dbus_message_unref (reply);
+ g_free (id_str);
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult