public inbox for ell@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: ell@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/2] dbus: add l_dbus_object_set_data()
Date: Wed,  7 Aug 2024 10:59:43 -0700	[thread overview]
Message-ID: <20240807175943.170002-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20240807175943.170002-1-prestwoj@gmail.com>

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(+)

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;
-- 
2.34.1


  reply	other threads:[~2024-08-07 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 17:59 [PATCH 1/2] dbus: add _dbus_object_tree_set_interface_data James Prestwood
2024-08-07 17:59 ` James Prestwood [this message]
2024-08-08 14:19   ` [PATCH 2/2] dbus: add l_dbus_object_set_data() Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240807175943.170002-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=ell@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox