]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd-bus-container-read.c
Merge pull request #16678 from poettering/loop-configure
[thirdparty/systemd.git] / man / sd-bus-container-read.c
CommitLineData
7cd40caa
DDM
1#include <stdio.h>
2
3#include <systemd/sd-bus.h>
4
5int read_strings_from_message(sd_bus_message *m) {
6 int r;
7
8 r = sd_bus_message_enter_container(m, 'a', "s");
9 if (r < 0)
10 return r;
11
12 for (;;) {
13 const char *s;
14
15 r = sd_bus_message_read(m, "s", &s);
16 if (r < 0)
17 return r;
18 if (r == 0)
19 break;
20
21 printf("%s\n", s);
22 }
23
24 return sd_bus_message_exit_container(m);
25}