Commit e8bf15b2 authored by Havoc Pennington's avatar Havoc Pennington

2003-04-24 Havoc Pennington <hp@redhat.com>

	* dbus/dbus-message.c (dbus_message_name_is): rename
	(dbus_message_service_is): rename
	(dbus_message_sender_is): rename
	(dbus_message_get_service): rename
parent c9cd648f
2003-04-24 Havoc Pennington <hp@redhat.com>
* 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 <hp@redhat.com>
* configure.in: add --enable-checks
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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
......
......@@ -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;
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment