Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   sd_bus_message_appendv    ( 3 )

прикрепляйте поля к сообщению D-Bus на основе строки типа (Attach fields to a D-Bus message based on a type string)

  Name  |  Synopsis  |  Description  |  Types string grammar  |    Examples    |  Return value  |  Note  |  See also  |

Примеры (Examples)

Append a single basic type (the string "a string"):

sd_bus_message *m; ... sd_bus_message_append(m, "s", "a string");

Append all types of integers:

uint8_t y = 1; int16_t n = 2; uint16_t q = 3; int32_t i = 4; uint32_t u = 5; int32_t x = 6; uint32_t t = 7; double d = 8.0; sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d);

Append a structure composed of a string and a D-Bus path:

sd_bus_message_append(m, "(so)", "a string", "/a/path");

Append an array of UNIX file descriptors:

sd_bus_message_append(m, "ah", 3, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO);

Append a variant, with the real type "g" (signature), and value "sdbusisgood":

sd_bus_message_append(m, "v", "g", "sdbusisgood");

Append a dictionary containing the mapping {1=>"a", 2=>"b", 3=>""}:

sd_bus_message_append(m, "a{is}", 3, 1, "a", 2, "b", 3, NULL);