summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-06 19:15:36 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-14 22:58:43 +0200
commit04552566fa357d3029f06b66690dc28752522e10 (patch)
tree03e9ebdcee5d7d9570b0ed2285af5a032b2fbab2 /src/libsystemd
parente30bb6b53b0ae1d1da99c52266d9dec8c6ba0ae4 (diff)
bus: add userdata API for bus name tracker objects
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/libsystemd.sym.m42
-rw-r--r--src/libsystemd/sd-bus/bus-track.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4
index d18d5767b0..14d9dcf9e9 100644
--- a/src/libsystemd/libsystemd.sym.m4
+++ b/src/libsystemd/libsystemd.sym.m4
@@ -331,6 +331,8 @@ m4_ifdef(`ENABLE_KDBUS',
sd_bus_track_ref;
sd_bus_track_unref;
sd_bus_track_get_bus;
+ sd_bus_track_get_userdata;
+ sd_bus_track_set_userdata;
sd_bus_track_add_sender;
sd_bus_track_remove_sender;
sd_bus_track_add_name;
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
index e21959d01d..0f6a2eafbd 100644
--- a/src/libsystemd/sd-bus/bus-track.c
+++ b/src/libsystemd/sd-bus/bus-track.c
@@ -312,3 +312,20 @@ void bus_track_dispatch(sd_bus_track *track) {
sd_bus_track_unref(track);
}
+
+_public_ void *sd_bus_track_get_userdata(sd_bus_track *track) {
+ assert_return(track, NULL);
+
+ return track->userdata;
+}
+
+_public_ void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata) {
+ void *ret;
+
+ assert_return(track, NULL);
+
+ ret = track->userdata;
+ track->userdata = userdata;
+
+ return ret;
+}