chiark / gitweb /
bus: properly implement logic for generating InterfacesAdded/InterfacesRemoved signal...
[elogind.git] / src / libsystemd-bus / bus-internal.h
index 5795f74693e282536abbf72337ba18ff29cddc73..6499d6b013a76c5ee0f2b7434a0e8b26c4de298a 100644 (file)
@@ -289,3 +289,8 @@ int bus_start_running(sd_bus *bus);
 int bus_next_address(sd_bus *bus);
 
 bool bus_pid_changed(sd_bus *bus);
+
+#define OBJECT_PATH_FOREACH_PREFIX(prefix, path)                        \
+        for (char *_slash = ({ strcpy((prefix), (path)); streq((prefix), "/") ? NULL : strrchr((prefix), '/'); }) ; \
+             _slash && !(_slash[(_slash) == (prefix)] = 0);             \
+             _slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))