diff options
author | Havoc Pennington <hp@redhat.com> | 2005-04-24 14:04:16 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2005-04-24 14:04:16 +0000 |
commit | 64f3d8f67db09e0c84ed3ff009b86d0127fe82b4 (patch) | |
tree | 1d090b30b2cdbf6dda54e6a9f961718db6b51552 /dbus/dbus-connection.c | |
parent | 52fce19fabf2e529c9bd332bcf8c5a4b56e42725 (diff) |
2005-04-23 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.c (dbus_message_append_args): fix doc comment,
reported by Tony Houghton
* test/test-service.c (main): test
dbus_connection_get_object_path_data()
* dbus/dbus-object-tree.c (find_handler): be sure we always init
the exact_match
(_dbus_object_tree_get_user_data_unlocked): new function used by
dbus_connection_get_object_path_data()
(do_register): add assertion test for get_user_data_unlocked
(object_tree_test_iteration): more tests
* dbus/dbus-connection.c (dbus_connection_get_object_path_data):
new function from Dan Reed to let you get the user data from
dbus_connection_register_object_path()
Diffstat (limited to 'dbus/dbus-connection.c')
-rw-r--r-- | dbus/dbus-connection.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index df8de937..edc57b84 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -4301,6 +4301,43 @@ dbus_connection_unregister_object_path (DBusConnection *connection, } /** + * Gets the user data passed to dbus_connection_register_object_path() + * or dbus_connection_register_fallback(). If nothing was registered + * at this path, the data is filled in with #NULL. + * + * @param connection the connection + * @param path the path you registered with + * @param data_p location to store the user data, or #NULL + * @returns #FALSE if not enough memory + */ +dbus_bool_t +dbus_connection_get_object_path_data (DBusConnection *connection, + const char *path, + void **data_p) +{ + char **decomposed_path; + + _dbus_return_val_if_fail (connection != NULL, FALSE); + _dbus_return_val_if_fail (path != NULL, FALSE); + _dbus_return_val_if_fail (data_p != NULL, FALSE); + + *data_p = NULL; + + if (!_dbus_decompose_path (path, strlen (path), &decomposed_path, NULL)) + return FALSE; + + CONNECTION_LOCK (connection); + + *data_p = _dbus_object_tree_get_user_data_unlocked (connection->objects, (const char**) decomposed_path); + + CONNECTION_UNLOCK (connection); + + dbus_free_string_array (decomposed_path); + + return TRUE; +} + +/** * Lists the registered fallback handlers and object path handlers at * the given parent_path. The returned array should be freed with * dbus_free_string_array(). |