summaryrefslogtreecommitdiff
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
parentb5af2aca120f1bf13cffc270803c2232918dd967 (diff)
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;
+}