From 34e6c6ff31e0bd27bf18c0e3c68b3a1ea9f0448d Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 13 Feb 2003 15:29:18 +0000 Subject: [PATCH] 2003-02-13 Anders Carlsson * bus/driver.c: (bus_driver_send_welcome_message), (bus_driver_handle_list_services), (bus_driver_handle_acquire_service), (bus_driver_handle_service_exists), (bus_driver_handle_message): Update for API changes in libdbus. * dbus/dbus-message.c: (dbus_message_new_reply): * dbus/dbus-message.h: Remove the name argument. The spec states that replies shouldn't have a name. --- ChangeLog | 13 +++++++++++++ bus/driver.c | 15 +++++++-------- dbus/dbus-message.c | 9 +++++---- dbus/dbus-message.h | 3 +-- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa82d19..5cee6df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2003-02-13 Anders Carlsson + * bus/driver.c: (bus_driver_send_welcome_message), + (bus_driver_handle_list_services), + (bus_driver_handle_acquire_service), + (bus_driver_handle_service_exists), (bus_driver_handle_message): + Update for API changes in libdbus. + + * dbus/dbus-message.c: (dbus_message_new_reply): + * dbus/dbus-message.h: + Remove the name argument. The spec states that replies shouldn't + have a name. + +2003-02-13 Anders Carlsson + * bus/desktop-file.c: (parse_section_start), (parse_key_value), (report_error), (bus_desktop_file_load), (lookup_section), (lookup_line), (bus_desktop_file_get_raw), diff --git a/bus/driver.c b/bus/driver.c index 71b780b..403cfc5 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -201,8 +201,7 @@ bus_driver_send_welcome_message (DBusConnection *connection, name = bus_connection_get_name (connection); _dbus_assert (name != NULL); - _DBUS_HANDLE_OOM (welcome = dbus_message_new_reply (DBUS_MESSAGE_HELLO, - hello_message)); + _DBUS_HANDLE_OOM (welcome = dbus_message_new_reply (hello_message)); _DBUS_HANDLE_OOM (dbus_message_set_sender (welcome, DBUS_SERVICE_DBUS)); @@ -223,7 +222,7 @@ bus_driver_handle_list_services (DBusConnection *connection, int len, i; char **services; - _DBUS_HANDLE_OOM (reply = dbus_message_new_reply (DBUS_MESSAGE_LIST_SERVICES, message)); + _DBUS_HANDLE_OOM (reply = dbus_message_new_reply (message)); _DBUS_HANDLE_OOM (services = bus_services_list (&len)); @@ -244,8 +243,8 @@ bus_driver_handle_list_services (DBusConnection *connection, } static void -bus_driver_handle_own_service (DBusConnection *connection, - DBusMessage *message) +bus_driver_handle_acquire_service (DBusConnection *connection, + DBusMessage *message) { DBusMessage *reply; DBusResultCode result; @@ -272,7 +271,7 @@ bus_driver_handle_own_service (DBusConnection *connection, _dbus_string_init_const (&service_name, name); service = bus_service_lookup (&service_name, TRUE); - _DBUS_HANDLE_OOM ((reply = dbus_message_new_reply (DBUS_MESSAGE_ACQUIRE_SERVICE, message))); + _DBUS_HANDLE_OOM ((reply = dbus_message_new_reply (message))); /* * Check if the service already has an owner @@ -355,7 +354,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, _dbus_string_init_const (&service_name, name); service = bus_service_lookup (&service_name, FALSE); - _DBUS_HANDLE_OOM ((reply = dbus_message_new_reply (DBUS_MESSAGE_ACQUIRE_SERVICE, message))); + _DBUS_HANDLE_OOM ((reply = dbus_message_new_reply (message))); _DBUS_HANDLE_OOM (dbus_message_set_sender (reply, DBUS_SERVICE_DBUS)); _DBUS_HANDLE_OOM (dbus_message_append_fields (reply, @@ -391,7 +390,7 @@ bus_driver_handle_message (DBusConnection *connection, else if (strcmp (name, DBUS_MESSAGE_LIST_SERVICES) == 0) bus_driver_handle_list_services (connection, message); else if (strcmp (name, DBUS_MESSAGE_ACQUIRE_SERVICE) == 0) - bus_driver_handle_own_service (connection, message); + bus_driver_handle_acquire_service (connection, message); else if (strcmp (name, DBUS_MESSAGE_SERVICE_EXISTS) == 0) bus_driver_handle_service_exists (connection, message); diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 344aa47..e641b59 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -787,15 +787,16 @@ dbus_message_new (const char *service, * @see dbus_message_new(), dbus_message_unref() */ DBusMessage* -dbus_message_new_reply (const char *name, - DBusMessage *original_message) +dbus_message_new_reply (DBusMessage *original_message) { DBusMessage *message; - const char *sender; + const char *sender, *name; sender = get_string_field (original_message, FIELD_SENDER, NULL); - + name = get_string_field (original_message, + FIELD_NAME, NULL); + _dbus_assert (sender != NULL); message = dbus_message_new (sender, name); diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index 3fed70e..753cc38 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -38,8 +38,7 @@ typedef struct DBusMessageIter DBusMessageIter; DBusMessage* dbus_message_new (const char *service, const char *name); -DBusMessage* dbus_message_new_reply (const char *name, - DBusMessage *original_message); +DBusMessage* dbus_message_new_reply (DBusMessage *original_message); DBusMessage *dbus_message_new_from_message (const DBusMessage *message); void dbus_message_ref (DBusMessage *message); -- 2.7.4