From: Havoc Pennington Date: Thu, 24 Apr 2003 19:35:11 +0000 (+0000) Subject: 2003-04-24 Havoc Pennington X-Git-Tag: dbus-0.10~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8bf15b23a2a9c5b19ef25fb553006a41379bf7c;p=platform%2Fupstream%2Fdbus.git 2003-04-24 Havoc Pennington * dbus/dbus-message.c (dbus_message_name_is): rename (dbus_message_service_is): rename (dbus_message_sender_is): rename (dbus_message_get_service): rename --- diff --git a/ChangeLog b/ChangeLog index 270d0d1..8faf50d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-04-24 Havoc Pennington + * dbus/dbus-message.c (dbus_message_name_is): rename + (dbus_message_service_is): rename + (dbus_message_sender_is): rename + (dbus_message_get_service): rename + +2003-04-24 Havoc Pennington + * configure.in: add --enable-checks * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments diff --git a/bus/bus.c b/bus/bus.c index 414f15e..53ad8e6 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -889,7 +889,7 @@ bus_context_check_security_policy (BusContext *context, context->registry, recipient, message)) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "A security policy in place prevents this sender " "from sending this message to this recipient, " @@ -905,7 +905,7 @@ bus_context_check_security_policy (BusContext *context, context->registry, sender, message)) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "A security policy in place prevents this recipient " "from receiving this message from this sender, " @@ -921,7 +921,7 @@ bus_context_check_security_policy (BusContext *context, dbus_connection_get_outgoing_size (recipient) > context->max_outgoing_bytes) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED, "The destination service \"%s\" has a full message queue", dest ? dest : DBUS_SERVICE_DBUS); diff --git a/bus/dispatch.c b/bus/dispatch.c index e38b340..14c6531 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -125,7 +125,7 @@ bus_dispatch (DBusConnection *connection, /* Ref connection in case we disconnect it at some point in here */ dbus_connection_ref (connection); - service_name = dbus_message_get_service (message); + service_name = dbus_message_get_destination (message); message_name = dbus_message_get_name (message); _dbus_assert (message_name != NULL); /* DBusMessageLoader is supposed to check this */ @@ -176,7 +176,7 @@ bus_dispatch (DBusConnection *connection, * reallocated, and thus the service_name pointer will become * invalid. */ - service_name = dbus_message_get_service (message); + service_name = dbus_message_get_destination (message); } if (strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */ diff --git a/bus/policy.c b/bus/policy.c index 7d9b4b7..0a002a8 100644 --- a/bus/policy.c +++ b/bus/policy.c @@ -693,8 +693,8 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, if (rule->d.send.message_name != NULL) { - if (!dbus_message_name_is (message, - rule->d.send.message_name)) + if (!dbus_message_has_name (message, + rule->d.send.message_name)) continue; } @@ -707,8 +707,8 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, */ if (receiver == NULL) { - if (!dbus_message_sender_is (message, - rule->d.send.destination)) + if (!dbus_message_has_sender (message, + rule->d.send.destination)) continue; } else @@ -765,8 +765,8 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, if (rule->d.receive.message_name != NULL) { - if (!dbus_message_name_is (message, - rule->d.receive.message_name)) + if (!dbus_message_has_name (message, + rule->d.receive.message_name)) continue; } @@ -779,8 +779,8 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, */ if (sender == NULL) { - if (!dbus_message_sender_is (message, - rule->d.receive.origin)) + if (!dbus_message_has_sender (message, + rule->d.receive.origin)) continue; } else diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index c9053eb..29995fd 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -1197,17 +1197,12 @@ dbus_message_get_name (DBusMessage *message) /** * Gets the destination service of a message. - * - * @todo I think if we have set_sender/get_sender, - * this function might be better named set_destination/ - * get_destination for clarity, as the sender - * is also a service name. * * @param message the message * @returns the message destination service (should not be freed) */ const char* -dbus_message_get_service (DBusMessage *message) +dbus_message_get_destination (DBusMessage *message) { _dbus_return_val_if_fail (message != NULL, NULL); @@ -3743,8 +3738,8 @@ dbus_message_get_sender (DBusMessage *message) * @returns #TRUE if the message has the given name */ dbus_bool_t -dbus_message_name_is (DBusMessage *message, - const char *name) +dbus_message_has_name (DBusMessage *message, + const char *name) { const char *n; @@ -3770,15 +3765,15 @@ dbus_message_name_is (DBusMessage *message, * @returns #TRUE if the message has the given destination service */ dbus_bool_t -dbus_message_service_is (DBusMessage *message, - const char *service) +dbus_message_has_destination (DBusMessage *message, + const char *service) { const char *s; _dbus_return_val_if_fail (message != NULL, FALSE); _dbus_return_val_if_fail (service != NULL, FALSE); - s = dbus_message_get_service (message); + s = dbus_message_get_destination (message); if (s && strcmp (s, service) == 0) return TRUE; @@ -3801,8 +3796,8 @@ dbus_message_service_is (DBusMessage *message, * @returns #TRUE if the message has the given origin service */ dbus_bool_t -dbus_message_sender_is (DBusMessage *message, - const char *service) +dbus_message_has_sender (DBusMessage *message, + const char *service) { const char *s; diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index f7ca1c4..177f5a9 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -56,8 +56,8 @@ struct DBusMessageIter }; -DBusMessage* dbus_message_new (const char *service, - const char *name); +DBusMessage* dbus_message_new (const char *name, + const char *destination_service); DBusMessage* dbus_message_new_reply (DBusMessage *original_message); DBusMessage* dbus_message_new_error_reply (DBusMessage *original_message, const char *error_name, @@ -67,18 +67,18 @@ DBusMessage *dbus_message_copy (const DBusMessage *message); void dbus_message_ref (DBusMessage *message); void dbus_message_unref (DBusMessage *message); const char* dbus_message_get_name (DBusMessage *message); -const char* dbus_message_get_service (DBusMessage *message); +const char* dbus_message_get_destination (DBusMessage *message); dbus_bool_t dbus_message_set_sender (DBusMessage *message, const char *sender); const char* dbus_message_get_sender (DBusMessage *message); void dbus_message_set_is_error (DBusMessage *message, dbus_bool_t is_error_reply); dbus_bool_t dbus_message_get_is_error (DBusMessage *message); -dbus_bool_t dbus_message_name_is (DBusMessage *message, +dbus_bool_t dbus_message_has_name (DBusMessage *message, const char *name); -dbus_bool_t dbus_message_service_is (DBusMessage *message, +dbus_bool_t dbus_message_has_destination (DBusMessage *message, const char *service); -dbus_bool_t dbus_message_sender_is (DBusMessage *message, +dbus_bool_t dbus_message_has_sender (DBusMessage *message, const char *service); dbus_uint32_t dbus_message_get_serial (DBusMessage *message); dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message,