Message ID | 20240807175943.170002-2-prestwoj@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/2] dbus: add _dbus_object_tree_set_interface_data | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
Hi James, On 8/7/24 12:59 PM, James Prestwood wrote: > Modifies the user data of an existing DBus object. > --- > ell/dbus.c | 13 +++++++++++++ > ell/dbus.h | 2 ++ > ell/ell.sym | 1 + > 3 files changed, 16 insertions(+) > <snip> > diff --git a/ell/ell.sym b/ell/ell.sym > index 0dad73f..aafc0a4 100644 > --- a/ell/ell.sym > +++ b/ell/ell.sym > @@ -225,6 +225,7 @@ global: > l_dbus_object_add_interface; > l_dbus_object_remove_interface; > l_dbus_object_get_data; > + l_dbus_object_set_data; > l_dbus_object_manager_enable; > l_dbus_add_disconnect_watch; > l_dbus_add_service_watch; Seems we use tabs here, not spaces. I fixed that and applied both. Thanks. Regards, -Denis
diff --git a/ell/dbus.c b/ell/dbus.c index a1ce09e..cd14eef 100644 --- a/ell/dbus.c +++ b/ell/dbus.c @@ -1694,6 +1694,19 @@ LIB_EXPORT void *l_dbus_object_get_data(struct l_dbus *dbus, const char *object, interface); } +LIB_EXPORT bool l_dbus_object_set_data(struct l_dbus *dbus, const char *object, + const char *interface, void *user_data) +{ + if (unlikely(!dbus)) + return false; + + if (unlikely(!dbus->tree)) + return false; + + return _dbus_object_tree_set_interface_data(dbus->tree, object, + interface, user_data); +} + LIB_EXPORT bool l_dbus_object_manager_enable(struct l_dbus *dbus, const char *root) { diff --git a/ell/dbus.h b/ell/dbus.h index 21bd4bf..6ec9c83 100644 --- a/ell/dbus.h +++ b/ell/dbus.h @@ -227,6 +227,8 @@ bool l_dbus_object_remove_interface(struct l_dbus *dbus, const char *object, const char *interface); void *l_dbus_object_get_data(struct l_dbus *dbus, const char *object, const char *interface); +bool l_dbus_object_set_data(struct l_dbus *dbus, const char *object, + const char *interface, void *user_data); bool l_dbus_object_manager_enable(struct l_dbus *dbus, const char *root); diff --git a/ell/ell.sym b/ell/ell.sym index 0dad73f..aafc0a4 100644 --- a/ell/ell.sym +++ b/ell/ell.sym @@ -225,6 +225,7 @@ global: l_dbus_object_add_interface; l_dbus_object_remove_interface; l_dbus_object_get_data; + l_dbus_object_set_data; l_dbus_object_manager_enable; l_dbus_add_disconnect_watch; l_dbus_add_service_watch;