From b29ea9115ea3277354b7ccbe442026279220f4ac Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 11 Aug 2003 02:11:58 +0000 Subject: 2003-08-10 Havoc Pennington * tools/dbus-send.c (main): add --type argument, for now supporting only method_call and signal types. * tools/dbus-print-message.c: print message type * dbus/dbus-connection.c (_dbus_connection_new_for_transport): init connection->objects * doc/dbus-specification.sgml: fix sgml * bus/*.c: port over to object-instance API changes * test/test-service.c: ditto * dbus/dbus-message.c (dbus_message_create_header): allow #NULL name, we will have to fix up the rest of the code to also handle this (dbus_message_new): generic message-creation call (set_string_field): allow appending name field --- test/test-service.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'test/test-service.c') diff --git a/test/test-service.c b/test/test-service.c index c2757acc..0771f33c 100644 --- a/test/test-service.c +++ b/test/test-service.c @@ -37,9 +37,9 @@ handle_echo (DBusConnection *connection, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) { - reply = dbus_message_new_error_reply (message, - error.name, - error.message); + reply = dbus_message_new_error (message, + error.name, + error.message); if (reply == NULL) die ("No memory\n"); @@ -52,7 +52,7 @@ handle_echo (DBusConnection *connection, return DBUS_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } - reply = dbus_message_new_reply (message); + reply = dbus_message_new_method_return (message); if (reply == NULL) die ("No memory\n"); @@ -99,11 +99,6 @@ main (int argc, DBusConnection *connection; DBusError error; DBusMessageHandler *handler; - const char *to_handle[] = { - "org.freedesktop.DBus.TestSuiteEcho", - "org.freedesktop.DBus.TestSuiteExit", - DBUS_MESSAGE_LOCAL_DISCONNECT, - }; int result; dbus_error_init (&error); @@ -127,8 +122,7 @@ main (int argc, if (handler == NULL) die ("No memory"); - if (!dbus_connection_register_handler (connection, handler, to_handle, - _DBUS_N_ELEMENTS (to_handle))) + if (!dbus_connection_add_filter (connection, handler)) die ("No memory"); result = dbus_bus_acquire_service (connection, "org.freedesktop.DBus.TestSuiteEchoService", -- cgit