diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-31 16:16:37 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-31 16:16:37 +0200 |
commit | 392d5b378ceae5e1fd7c91ca545fcf4cd105744a (patch) | |
tree | e231fe77155323de76b535cd509ee5677f1bf28f /src/libsystemd-bus/bus-control.c | |
parent | 11c4c2492083325531aeb3eeb9b041c929677890 (diff) |
bus: parse matches locally and allow registration of callbacks for them
This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.
Diffstat (limited to 'src/libsystemd-bus/bus-control.c')
-rw-r--r-- | src/libsystemd-bus/bus-control.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c index 06afaf3c76..dd404442cf 100644 --- a/src/libsystemd-bus/bus-control.c +++ b/src/libsystemd-bus/bus-control.c @@ -27,6 +27,7 @@ #include "sd-bus.h" #include "bus-internal.h" #include "bus-message.h" +#include "bus-control.h" int sd_bus_get_unique_name(sd_bus *bus, const char **unique) { int r; @@ -292,14 +293,12 @@ int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid) { return 0; } -int sd_bus_add_match(sd_bus *bus, const char *match) { +int bus_add_match_internal(sd_bus *bus, const char *match) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; int r; - if (!bus) - return -EINVAL; - if (!match) - return -EINVAL; + assert(bus); + assert(match); r = sd_bus_message_new_method_call( bus, @@ -318,14 +317,12 @@ int sd_bus_add_match(sd_bus *bus, const char *match) { return sd_bus_send_with_reply_and_block(bus, m, 0, NULL, &reply); } -int sd_bus_remove_match(sd_bus *bus, const char *match) { +int bus_remove_match_internal(sd_bus *bus, const char *match) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; int r; - if (!bus) - return -EINVAL; - if (!match) - return -EINVAL; + assert(bus); + assert(match); r = sd_bus_message_new_method_call( bus, |