diff --git a/man/sd_bus_message_read.xml b/man/sd_bus_message_read.xml index 526fb0e70a..2afa441742 100644 --- a/man/sd_bus_message_read.xml +++ b/man/sd_bus_message_read.xml @@ -60,13 +60,13 @@ For each type specified in the type string, one or more arguments need to be specified after the types parameter, in the same order. The arguments must be - pointers to appropriate types (a pointer to int8_t for a y in - the type string, a pointer to int32_t for an i, a pointer to - const char* for an s, ...) which are set based on the values in + pointers to appropriate types (a pointer to int8_t for a y in + the type string, a pointer to int32_t for an i, a pointer to + const char* for an s, ...) which are set based on the values in the message. As an exception, in case or array and variant types, the first argument is an "input" argument that further specifies how the message should be read. See the table below for a complete list of allowed arguments and their types. Note that, if the basic type is a pointer - (e.g., const char * in the case of a string), the argument is a pointer to a + (e.g., const char * in the case of a string), the argument is a pointer to a pointer, and also the pointer value that is written is only borrowed and the contents must be copied if they are to be used after the end of the messages lifetime. @@ -99,7 +99,7 @@ a SD_BUS_TYPE_ARRAY array - int, which specifies the expected length n of the array + int, which specifies the expected length n of the array n sets of arguments appropriate for the array element type @@ -174,6 +174,14 @@ int64_t x; sd_bus_message_read(m, "x", &x); + Read a boolean value: + + sd_bus_message *m; +int x; /* Do not use C99 'bool' type here, it's typically smaller + in memory and would cause memory corruption */ + +sd_bus_message_read(m, "b", &x); + Read all types of integers: uint8_t y; diff --git a/man/sd_bus_message_read_array.xml b/man/sd_bus_message_read_array.xml index 117afa9e31..26e8ebae60 100644 --- a/man/sd_bus_message_read_array.xml +++ b/man/sd_bus_message_read_array.xml @@ -48,6 +48,10 @@ appropriate for the data type. The data is part of the message — it may not be modified and is valid only as long as the message is referenced. After this function returns, the "read pointer" points at the next element after the array. + + Note that this function only supports arrays of trivial types, i.e. arrays of booleans, the various + integer types, as well as floating point numbers. In particular it may not be used for arrays of strings, + structures or similar. @@ -68,8 +72,8 @@ -EINVAL - Specified type is invalid or the message parameter or one of the output - parameters are NULL. + Specified type is invalid or not a trivial type (see above), or the message + parameter or one of the output parameters are NULL. diff --git a/man/sd_bus_message_read_basic.xml b/man/sd_bus_message_read_basic.xml index 101f5d21a4..0502976dce 100644 --- a/man/sd_bus_message_read_basic.xml +++ b/man/sd_bus_message_read_basic.xml @@ -55,10 +55,10 @@ If p is not NULL, it should contain a pointer to an appropriate object. For example, if type is 'y', the object passed in p - should have type uint8_t *. If type is + should have type uint8_t *. If type is 's', the object passed in p should - have type const char **. Note that, if the basic type is a pointer - (e.g., const char * in the case of a string), the pointer is only + have type const char **. Note that, if the basic type is a pointer + (e.g., const char * in the case of a string), the pointer is only borrowed and the contents must be copied if they are to be used after the end of the messages lifetime. Similarly, during the lifetime of such a pointer, the message must not be modified. See the table below for a complete list of allowed @@ -85,92 +85,92 @@ y SD_BUS_TYPE_BYTE - unsigned integer - uint8_t * + 8bit unsigned integer + uint8_t * b SD_BUS_TYPE_BOOLEAN boolean - int * + int * (NB: not bool *) n SD_BUS_TYPE_INT16 - signed integer - int16_t * + 16bit signed integer + int16_t * q SD_BUS_TYPE_UINT16 - unsigned integer - uint16_t * + 16bit unsigned integer + uint16_t * i SD_BUS_TYPE_INT32 - signed integer - int32_t * + 32bit signed integer + int32_t * u SD_BUS_TYPE_UINT32 - unsigned integer - uint32_t * + 32bit unsigned integer + uint32_t * x SD_BUS_TYPE_INT64 - signed integer - int64_t * + 64bit signed integer + int64_t * t SD_BUS_TYPE_UINT64 - unsigned integer - uint64_t * + 64bit unsigned integer + uint64_t * d SD_BUS_TYPE_DOUBLE - floating-point - double * + IEEE 754 double precision floating-point + double * s SD_BUS_TYPE_STRING - Unicode string - const char ** + UTF-8 string + const char ** o SD_BUS_TYPE_OBJECT_PATH - object path - const char ** + D-Bus object path stringy + const char ** g SD_BUS_TYPE_SIGNATURE - signature - const char ** + D-Bus signature string + const char ** h SD_BUS_TYPE_UNIX_FD UNIX file descriptor - int * + int *