summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-bus/bus-slot.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-18 17:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-18 17:49:53 +0200
commitcaa829849d6ac9f6e173f585f732054358311ae1 (patch)
treed4e90bf247457b9863f4465b82d8a855224e8bcd /src/libsystemd/sd-bus/bus-slot.c
parentMerge commit 'b39a2770ba55637da80e2e389222c59dbea73507' (diff)
downloadsystemd-caa829849d6ac9f6e173f585f732054358311ae1.tar.xz
systemd-caa829849d6ac9f6e173f585f732054358311ae1.zip
sd-bus: add API to query which handler/callback is currently being dispatched
Diffstat (limited to 'src/libsystemd/sd-bus/bus-slot.c')
-rw-r--r--src/libsystemd/sd-bus/bus-slot.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-slot.c b/src/libsystemd/sd-bus/bus-slot.c
index 5e927511d5..d6793c29e9 100644
--- a/src/libsystemd/sd-bus/bus-slot.c
+++ b/src/libsystemd/sd-bus/bus-slot.c
@@ -245,3 +245,23 @@ _public_ sd_bus_message *sd_bus_slot_get_current_message(sd_bus_slot *slot) {
return slot->bus->current_message;
}
+
+_public_ sd_bus_message_handler_t sd_bus_slot_get_current_handler(sd_bus_slot *slot) {
+ assert_return(slot, NULL);
+ assert_return(slot->type >= 0, NULL);
+
+ if (slot->bus->current_slot != slot)
+ return NULL;
+
+ return slot->bus->current_handler;
+}
+
+_public_ void* sd_bus_slot_get_current_userdata(sd_bus_slot *slot) {
+ assert_return(slot, NULL);
+ assert_return(slot->type >= 0, NULL);
+
+ if (slot->bus->current_slot != slot)
+ return NULL;
+
+ return slot->bus->current_userdata;
+}