diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-18 17:41:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-18 17:49:53 +0200 |
commit | caa829849d6ac9f6e173f585f732054358311ae1 (patch) | |
tree | d4e90bf247457b9863f4465b82d8a855224e8bcd /src/libsystemd/sd-bus/bus-slot.c | |
parent | b5af2aca120f1bf13cffc270803c2232918dd967 (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.c | 20 |
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; +} |