From 85f8afb7065451e20e9105e56b8e427210a59119 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 13 Jun 2022 11:17:33 +0200 Subject: [PATCH] man: document sd_bus_message_read_strv_extend() --- man/rules/meson.build | 2 +- man/sd_bus_message_read_strv.xml | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/man/rules/meson.build b/man/rules/meson.build index b1d1c5d5954..277ab5e5933 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -361,7 +361,7 @@ manpages = [ ''], ['sd_bus_message_read_array', '3', [], ''], ['sd_bus_message_read_basic', '3', [], ''], - ['sd_bus_message_read_strv', '3', [], ''], + ['sd_bus_message_read_strv', '3', ['sd_bus_message_read_strv_extend'], ''], ['sd_bus_message_rewind', '3', [], ''], ['sd_bus_message_seal', '3', [], ''], ['sd_bus_message_sensitive', '3', [], ''], diff --git a/man/sd_bus_message_read_strv.xml b/man/sd_bus_message_read_strv.xml index 50580d86bcc..6f46c18e09b 100644 --- a/man/sd_bus_message_read_strv.xml +++ b/man/sd_bus_message_read_strv.xml @@ -17,6 +17,7 @@ sd_bus_message_read_strv + sd_bus_message_read_strv_extend Access an array of strings in a message @@ -30,26 +31,39 @@ sd_bus_message *m char ***l + + + int sd_bus_message_read_strv_extend + sd_bus_message *m + char ***l + Description - sd_bus_message_read_strv() gives access to an array of string-like items in + sd_bus_message_read_strv() reads an array of string-like items from the message m. The "read pointer" in the message must be right before an array of strings (D-Bus type as), object paths (D-Bus type ao), or signatures (D-Bus type ag). On success, a pointer to a - NULL-terminated array of strings is returned in the output parameter + NULL-terminated array of strings (strv) is returned in the output parameter l. Note that ownership of this array is transferred to the caller. Hence, the caller is responsible for freeing this array and its contents. + + sd_bus_message_read_strv_extend() is similar, but the second parameter is an + input-output parameter. If *l is NULL, if behaves identically + to sd_bus_message_read_strv(). Otherwise, *l must point to a + strv, which will be reallocated and extended with additional strings. This function is particularly + useful when combining multiple lists of strings in a message or messages into a single array of strings. + Return Value - On success, sd_bus_message_read_strv() returns a non-negative integer. On - failure, it returns a negative errno-style error code. + On success, these functions return a non-negative integer. On failure, they return a negative + errno-style error code. Errors -- 2.47.3