diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-04-28 19:04:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-05-06 10:22:54 +0200 |
commit | eff7c2d3c905dec9ea4e1d5e53a0efd6af7d3d26 (patch) | |
tree | 6d6859b1c5f04233d418da8ba26de65c924e3ac1 /man/vtable-example.c | |
parent | 7f3a5eb70e476708551445219f7aceb7afc0a4a0 (diff) | |
download | systemd-eff7c2d3c905dec9ea4e1d5e53a0efd6af7d3d26.tar.gz |
sd-bus: Add a nicer way of specifying sd-bus vtable method arguments
SD_BUS_NAMES_WITH_ARGS is a less error-prone way of specifying D-Bus
method arguments.
Diffstat (limited to 'man/vtable-example.c')
-rw-r--r-- | man/vtable-example.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/man/vtable-example.c b/man/vtable-example.c index 98c20eec52..dede12befd 100644 --- a/man/vtable-example.c +++ b/man/vtable-example.c @@ -27,6 +27,30 @@ static const sd_bus_vtable vtable[] = { "s", SD_BUS_PARAM(returnstring), method, offsetof(object, number), SD_BUS_VTABLE_DEPRECATED), + SD_BUS_METHOD_WITH_ARGS_OFFSET( + "Method3", + SD_BUS_ARGS("s", string, "o", path), + SD_BUS_RESULT("s", returnstring), + method, offsetof(object, number), + SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD_WITH_ARGS( + "Method4", + SD_BUS_NO_ARGS, + SD_BUS_NO_RESULT, + method, + SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_SIGNAL( + "Signal1", + "so", + 0), + SD_BUS_SIGNAL_WITH_NAMES( + "Signal2", + "so", SD_BUS_PARAM(string) SD_BUS_PARAM(path), + 0), + SD_BUS_SIGNAL_WITH_ARGS( + "Signal3", + SD_BUS_ARGS("s", string, "o", path), + 0), SD_BUS_WRITABLE_PROPERTY( "AutomaticStringProperty", "s", NULL, NULL, offsetof(object, name), |