summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-12-30 11:37:35 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-12-30 11:37:35 +0100
commitd95eb43e90f19ff0c9aaff1c5fb1a7ed9fbd89a5 (patch)
tree87325a4eaa726f00809ced8090e7cf6b38b186ae /tools
parent7d9fcc2bf6869993e5f38d5eb183fb59e8a52816 (diff)
bus: add sd_bus_emit_object_{added/removed}()
This implements two new helpers, discussed on systemd-devel about 1 year ago: sd_bus_emit_object_added() sd_bus_emit_object_removed() Both calls are equivalent to their respective counterpart sd_bus_emit_interfaces_{added/removed}(), but can figure out the list of interfaces themselves, instead of requiring the caller to provide them. Furthermore, both calls properly deal with builtin interfaces provided via org.freedesktop.DBus.* and alike. Both calls simply traverse a node and all its parent nodes to figure out a list of all interfaces registered as vtable or fallback. It then appends each of them, similar to the interfaces_{added/removed}() helpers. Note that interfaces_{added/removed}() runs a parent traversal for *each* passed interface. Therefore, it can simply bail out, once it found a parent node that implements a given interface. With object_{added/removed}() we cannot know the registered interfaces in advance, thus, we cannot run one traversal per node. Instead, we run a single traversal and remember all interfaces that we added. Therefore, a child-interface overrides all conflicting parent-interfaces. We keep a "Set *s" context to track those while climbing up the tree.
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions