From 55944e5e40b1be2afc4855d8d2baf4b73d1876b5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:49:52 +0200 Subject: Adding upstream version 255.4. Signed-off-by: Daniel Baumann --- man/sd-bus-container-append.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 man/sd-bus-container-append.c (limited to 'man/sd-bus-container-append.c') diff --git a/man/sd-bus-container-append.c b/man/sd-bus-container-append.c new file mode 100644 index 0000000..8bb4f33 --- /dev/null +++ b/man/sd-bus-container-append.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT-0 */ + +#include + +int append_strings_to_message(sd_bus_message *m, const char *const *arr) { + int r; + + r = sd_bus_message_open_container(m, 'a', "s"); + if (r < 0) + return r; + + for (const char *s = *arr; *s; s++) { + r = sd_bus_message_append(m, "s", s); + if (r < 0) + return r; + } + + return sd_bus_message_close_container(m); +} -- cgit v1.2.3