summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-match.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-15 01:15:30 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-15 01:15:30 +0200
commit19befb2d5fc087f96e40ddc432b2cc9385666209 (patch)
tree4a28a54ed25ba8fb57578f639b2691749c9c935e /src/libsystemd/sd-bus/bus-match.h
parent9a78148e40402b44f361f4fbf63bb97a21aeac0b (diff)
sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
Diffstat (limited to 'src/libsystemd/sd-bus/bus-match.h')
-rw-r--r--src/libsystemd/sd-bus/bus-match.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/bus-match.h b/src/libsystemd/sd-bus/bus-match.h
index 056082b908..af5f65d073 100644
--- a/src/libsystemd/sd-bus/bus-match.h
+++ b/src/libsystemd/sd-bus/bus-match.h
@@ -58,10 +58,7 @@ struct bus_match_node {
uint8_t u8;
} value;
struct {
- sd_bus_message_handler_t callback;
- void *userdata;
- unsigned last_iteration;
- uint64_t cookie;
+ struct match_callback *callback;
} leaf;
struct {
/* If this is set, then the child is NULL */
@@ -78,8 +75,10 @@ struct bus_match_component {
int bus_match_run(sd_bus *bus, struct bus_match_node *root, sd_bus_message *m);
-int bus_match_add(struct bus_match_node *root, struct bus_match_component *components, unsigned n_components, sd_bus_message_handler_t callback, void *userdata, uint64_t cookie, struct bus_match_node **ret);
-int bus_match_remove(struct bus_match_node *root, struct bus_match_component *components, unsigned n_components, sd_bus_message_handler_t callback, void *userdata, uint64_t *cookie);
+int bus_match_add(struct bus_match_node *root, struct bus_match_component *components, unsigned n_components, struct match_callback *callback);
+int bus_match_remove(struct bus_match_node *root, struct match_callback *callback);
+
+int bus_match_find(struct bus_match_node *root, struct bus_match_component *components, unsigned n_components, sd_bus_message_handler_t callback, void *userdata, struct match_callback **ret);
void bus_match_free(struct bus_match_node *node);