diff options
author | Michael Meeks <michael@ximian.com> | 2004-03-29 13:11:05 +0000 |
---|---|---|
committer | Michael Meeks <michael@ximian.com> | 2004-03-29 13:11:05 +0000 |
commit | 004b37eca4ed9a33269d4850525a0e1c2f5deaff (patch) | |
tree | ab72056115269370b018373aef20c5a8d457acb8 /dbus | |
parent | d7a044a1382782cae8f1311355b78b4b5ff587dd (diff) | |
download | dbus-004b37eca4ed9a33269d4850525a0e1c2f5deaff.tar.gz |
2004-03-29 Michael Meeks <michael@ximian.com>
* dbus/dbus-message.c
(dbus_message_new_error_printf): impl.
* dbus/dbus-connection.c
(dbus_connection_unregister_object_path): fix warning.
* configure.in: fix no-mono-installed situation.
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-connection.c | 3 | ||||
-rw-r--r-- | dbus/dbus-message.c | 39 | ||||
-rw-r--r-- | dbus/dbus-message.h | 4 |
3 files changed, 44 insertions, 2 deletions
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index b65b541e..2974c596 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -3237,8 +3237,7 @@ dbus_connection_unregister_object_path (DBusConnection *connection, CONNECTION_LOCK (connection); - return _dbus_object_tree_unregister_and_unlock (connection->objects, - path); + _dbus_object_tree_unregister_and_unlock (connection->objects, path); } /** diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index d56cd45d..322e5d0b 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -1422,6 +1422,45 @@ dbus_message_new_error (DBusMessage *reply_to, } /** + * Creates a new message that is an error reply to a certain message. + * Error replies are possible in response to method calls primarily. + * + * @param reply_to the original message + * @param error_name the error name + * @param error_format the error message string to be printed + * @param ... value of first argument, list of additional values to print + * @returns a new error message + */ +DBusMessage* +dbus_message_new_error_printf (DBusMessage *reply_to, + const char *error_name, + const char *error_format, + ...) +{ + va_list args; + DBusString str; + DBusMessage *message; + + if (!_dbus_string_init (&str)) + return NULL; + + va_start (args, error_format); + + if (_dbus_string_append_printf_valist (&str, error_format, args)) + message = dbus_message_new_error (reply_to, error_name, + _dbus_string_get_const_data (&str)); + else + message = NULL; + + _dbus_string_free (&str); + + va_end (args); + + return message; +} + + +/** * Creates a new message that is an exact replica of the message * specified, except that its refcount is set to 1. * diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index 51676698..046cad56 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -72,6 +72,10 @@ DBusMessage* dbus_message_new_signal (const char *path, DBusMessage* dbus_message_new_error (DBusMessage *reply_to, const char *error_name, const char *error_message); +DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to, + const char *error_name, + const char *error_format, + ...); DBusMessage* dbus_message_copy (const DBusMessage *message); |