]> git.proxmox.com Git - systemd.git/blobdiff - man/sd_bus_message_append.html
Imported Upstream version 217
[systemd.git] / man / sd_bus_message_append.html
index 9fa03ff9e825e9b3aad72986137d1b84a54bfb74..53a03c776ea874b236fe2267bd32929582f1a33c 100644 (file)
@@ -19,7 +19,7 @@
   <a href="systemd.directives.html">Directives </a>·
   <a href="../python-systemd/index.html">Python </a>·
   <a href="../libudev/index.html">libudev </a>·
-  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="sd_bus_message_append"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_message_append — Attach parts of message based on a format string</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-bus.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int sd_bus_message_append(</code></td><td>sd_bus_message *<var class="pdparam">m</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">types</var>, </td></tr><tr><td> </td><td>...<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm214183901008"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>The <code class="function">sd_bus_message_append</code> function appends
+  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 217</span><hr><div class="refentry"><a name="sd_bus_message_append"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_message_append — Attach parts of message based on a format string</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-bus.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int sd_bus_message_append(</code></td><td>sd_bus_message *<var class="pdparam">m</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">types</var>, </td></tr><tr><td> </td><td>...<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm214180087808"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>The <code class="function">sd_bus_message_append</code> function appends
     a sequence of items to message <em class="parameter"><code>m</code></em>. The
     format string <em class="parameter"><code>types</code></em> describes the types of
     arguments that follow.</p><p>The format string is composed of the elements shown in the
@@ -45,7 +45,7 @@
     types must be a basic type. Corresponding arguments must include
     the size of the dictionary, and then repeated this number of
     times, arguments corresponding to each of the two nested
-    types.</p><div class="table"><a name="idm214184578560"></a><p class="title"><b>Table 1. Item format specifiers</b></p><div class="table-contents"><table summary="Item format specifiers" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Specifier</th><th>Constant</th><th>Description</th><th>Size</th></tr></thead><tbody><tr><td>"<code class="literal">y</code>"</td><td><code class="constant">SD_BUS_TYPE_BYTE</code></td><td>unsigned interger</td><td>1 byte</td></tr><tr><td>"<code class="literal">b</code>"</td><td><code class="constant">SD_BUS_TYPE_BOOLEAN</code></td><td>boolean</td><td>4 bytes</td></tr><tr><td>"<code class="literal">n</code>"</td><td><code class="constant">SD_BUS_TYPE_INT16</code></td><td>signed integer</td><td>2 bytes</td></tr><tr><td>"<code class="literal">q</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT16</code></td><td>unsigned integer</td><td>2 bytes</td></tr><tr><td>"<code class="literal">i</code>"</td><td><code class="constant">SD_BUS_TYPE_INT32</code></td><td>signed integer</td><td>4 bytes</td></tr><tr><td>"<code class="literal">u</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT32</code></td><td>unsigned integer</td><td>4 bytes</td></tr><tr><td>"<code class="literal">x</code>"</td><td><code class="constant">SD_BUS_TYPE_INT64</code></td><td>signed integer</td><td>8 bytes</td></tr><tr><td>"<code class="literal">t</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT64</code></td><td>unsigned integer</td><td>8 bytes</td></tr><tr><td>"<code class="literal">d</code>"</td><td><code class="constant">SD_BUS_TYPE_DOUBLE</code></td><td>floating-point</td><td>8 bytes</td></tr><tr><td>"<code class="literal">s</code>"</td><td><code class="constant">SD_BUS_TYPE_STRING</code></td><td>Unicode string</td><td>variable</td></tr><tr><td>"<code class="literal">o</code>"</td><td><code class="constant">SD_BUS_TYPE_OBJECT_PATH</code></td><td>object path</td><td>variable</td></tr><tr><td>"<code class="literal">g</code>"</td><td><code class="constant">SD_BUS_TYPE_SIGNATURE</code></td><td>signature</td><td>variable</td></tr><tr><td>"<code class="literal">h</code>"</td><td><code class="constant">SD_BUS_TYPE_UNIX_FD</code></td><td>UNIX file descriptor</td><td>4 bytes</td></tr><tr><td>"<code class="literal">a</code>"</td><td><code class="constant">SD_BUS_TYPE_ARRAY</code></td><td>array</td><td>determined by array type and size</td></tr><tr><td>"<code class="literal">v</code>"</td><td><code class="constant">SD_BUS_TYPE_VARIANT</code></td><td>variant</td><td>determined by the type argument</td></tr><tr><td>"<code class="literal">(</code>"</td><td><code class="constant">SD_BUS_TYPE_STRUCT_BEGIN</code></td><td>array start</td><td rowspan="2">determined by the nested types</td></tr><tr><td>"<code class="literal">)</code>"</td><td><code class="constant">SD_BUS_TYPE_STRUCT_END</code></td><td>array end</td></tr><tr><td>"<code class="literal">{</code>"</td><td><code class="constant">SD_BUS_TYPE_DICT_ENTRY_BEGIN</code></td><td>dictionary entry start</td><td rowspan="2">determined by the nested types</td></tr><tr><td>"<code class="literal">}</code>"</td><td><code class="constant">SD_BUS_TYPE_DICT_ENTRY_END</code></td><td>dictionary entry end</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idm214183669216"></a><h2 id="Types string grammar">Types string grammar<a class="headerlink" title="Permalink to this headline" href="#Types%20string%20grammar">¶</a></h2><pre class="programlisting">types ::= complete_type*
+    types.</p><div class="table"><a name="idm214184030848"></a><p class="title"><b>Table 1. Item format specifiers</b></p><div class="table-contents"><table summary="Item format specifiers" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Specifier</th><th>Constant</th><th>Description</th><th>Size</th></tr></thead><tbody><tr><td>"<code class="literal">y</code>"</td><td><code class="constant">SD_BUS_TYPE_BYTE</code></td><td>unsigned integer</td><td>1 byte</td></tr><tr><td>"<code class="literal">b</code>"</td><td><code class="constant">SD_BUS_TYPE_BOOLEAN</code></td><td>boolean</td><td>4 bytes</td></tr><tr><td>"<code class="literal">n</code>"</td><td><code class="constant">SD_BUS_TYPE_INT16</code></td><td>signed integer</td><td>2 bytes</td></tr><tr><td>"<code class="literal">q</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT16</code></td><td>unsigned integer</td><td>2 bytes</td></tr><tr><td>"<code class="literal">i</code>"</td><td><code class="constant">SD_BUS_TYPE_INT32</code></td><td>signed integer</td><td>4 bytes</td></tr><tr><td>"<code class="literal">u</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT32</code></td><td>unsigned integer</td><td>4 bytes</td></tr><tr><td>"<code class="literal">x</code>"</td><td><code class="constant">SD_BUS_TYPE_INT64</code></td><td>signed integer</td><td>8 bytes</td></tr><tr><td>"<code class="literal">t</code>"</td><td><code class="constant">SD_BUS_TYPE_UINT64</code></td><td>unsigned integer</td><td>8 bytes</td></tr><tr><td>"<code class="literal">d</code>"</td><td><code class="constant">SD_BUS_TYPE_DOUBLE</code></td><td>floating-point</td><td>8 bytes</td></tr><tr><td>"<code class="literal">s</code>"</td><td><code class="constant">SD_BUS_TYPE_STRING</code></td><td>Unicode string</td><td>variable</td></tr><tr><td>"<code class="literal">o</code>"</td><td><code class="constant">SD_BUS_TYPE_OBJECT_PATH</code></td><td>object path</td><td>variable</td></tr><tr><td>"<code class="literal">g</code>"</td><td><code class="constant">SD_BUS_TYPE_SIGNATURE</code></td><td>signature</td><td>variable</td></tr><tr><td>"<code class="literal">h</code>"</td><td><code class="constant">SD_BUS_TYPE_UNIX_FD</code></td><td>UNIX file descriptor</td><td>4 bytes</td></tr><tr><td>"<code class="literal">a</code>"</td><td><code class="constant">SD_BUS_TYPE_ARRAY</code></td><td>array</td><td>determined by array type and size</td></tr><tr><td>"<code class="literal">v</code>"</td><td><code class="constant">SD_BUS_TYPE_VARIANT</code></td><td>variant</td><td>determined by the type argument</td></tr><tr><td>"<code class="literal">(</code>"</td><td><code class="constant">SD_BUS_TYPE_STRUCT_BEGIN</code></td><td>array start</td><td rowspan="2">determined by the nested types</td></tr><tr><td>"<code class="literal">)</code>"</td><td><code class="constant">SD_BUS_TYPE_STRUCT_END</code></td><td>array end</td></tr><tr><td>"<code class="literal">{</code>"</td><td><code class="constant">SD_BUS_TYPE_DICT_ENTRY_BEGIN</code></td><td>dictionary entry start</td><td rowspan="2">determined by the nested types</td></tr><tr><td>"<code class="literal">}</code>"</td><td><code class="constant">SD_BUS_TYPE_DICT_ENTRY_END</code></td><td>dictionary entry end</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idm214184004368"></a><h2 id="Types string grammar">Types string grammar<a class="headerlink" title="Permalink to this headline" href="#Types%20string%20grammar">¶</a></h2><pre class="programlisting">types ::= complete_type*
 complete_type ::= basic_type | variant | structure | array | dictionary
 basic_type ::= "y" | "n" | "q" | "u" | "i" | "x" | "t" | "d" |
                "b" | "h" |
@@ -54,7 +54,7 @@ variant ::= "v"
 structure ::= "(" complete_type+ ")"
 array ::= "a" complete_type
 dictionary ::= "a" "{" basic_type complete_type "}"
-</pre></div><div class="refsect1"><a name="idm214182869216"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><p>Append a single basic type (the string "<code class="literal">a string</code>"):
+</pre></div><div class="refsect1"><a name="idm214184002544"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><p>Append a single basic type (the string "<code class="literal">a string</code>"):
     </p><pre class="programlisting">sd_bus_message *m;
 ...
 sd_bus_message_append(m, "s", "a string");</pre><p>Append all types of integers:</p><pre class="programlisting">uint8_t y = 1;
@@ -70,17 +70,17 @@ sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d);</pre><p>Append a s
 </pre><p>Append a variant, with the real type "g" (signature),
      and value "sdbusisgood":</p><pre class="programlisting">sd_bus_message_append(m, "v", "g", "sdbusisgood");</pre><p>Append a dictionary containing the mapping {1=&gt;"a", 2=&gt;"b", 3=&gt;""}:
      </p><pre class="programlisting">sd_bus_message_append(m, "a{is}", 3, 1, "a", 2, "b", 3, NULL);
-     </pre></div><div class="refsect1"><a name="idm214184952432"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value">¶</a></h2><p>On success, this call returns 0 or a positive
+     </pre></div><div class="refsect1"><a name="idm214183994432"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value">¶</a></h2><p>On success, this call returns 0 or a positive
     integer. On failure, this call returns a negative
-    errno-style error code.</p></div><div class="refsect1"><a name="errors"></a><h2 id="Errors">Errors<a class="headerlink" title="Permalink to this headline" href="#Errors">¶</a></h2><p>Returned errors may indicate the following problems:</p><div class="variablelist"><dl class="variablelist"><dt id="-EINVAL"><span class="term"><code class="varname">-EINVAL</code></span><a class="headerlink" title="Permalink to this term" href="#-EINVAL">¶</a></dt><dd><p>Specified parameter is invalid.
-        </p></dd><dt id="-EPERM"><span class="term"><code class="varname">-EPERM</code></span><a class="headerlink" title="Permalink to this term" href="#-EPERM">¶</a></dt><dd><p>Message has been sealed.
-        </p></dd><dt id="-ESTALE"><span class="term"><code class="varname">-ESTALE</code></span><a class="headerlink" title="Permalink to this term" href="#-ESTALE">¶</a></dt><dd><p>Message is in invalid state.
-        </p></dd><dt id="-ENXIO"><span class="term"><code class="varname">-ENXIO</code></span><a class="headerlink" title="Permalink to this term" href="#-ENXIO">¶</a></dt><dd><p>Message cannot be appended to.
-        </p></dd><dt id="-ENOMEM"><span class="term"><code class="varname">-ENOMEM</code></span><a class="headerlink" title="Permalink to this term" href="#-ENOMEM">¶</a></dt><dd><p>Memory allocation failed.</p></dd></dl></div></div><div class="refsect1"><a name="idm214183757376"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes">¶</a></h2><p><code class="function">sd_bus_open_user()</code> and other functions
+    errno-style error code.</p></div><div class="refsect1"><a name="errors"></a><h2 id="Errors">Errors<a class="headerlink" title="Permalink to this headline" href="#Errors">¶</a></h2><p>Returned errors may indicate the following problems:</p><div class="variablelist"><dl class="variablelist"><dt id="-EINVAL"><span class="term"><code class="constant">-EINVAL</code></span><a class="headerlink" title="Permalink to this term" href="#-EINVAL">¶</a></dt><dd><p>Specified parameter is invalid.
+        </p></dd><dt id="-EPERM"><span class="term"><code class="constant">-EPERM</code></span><a class="headerlink" title="Permalink to this term" href="#-EPERM">¶</a></dt><dd><p>Message has been sealed.
+        </p></dd><dt id="-ESTALE"><span class="term"><code class="constant">-ESTALE</code></span><a class="headerlink" title="Permalink to this term" href="#-ESTALE">¶</a></dt><dd><p>Message is in invalid state.
+        </p></dd><dt id="-ENXIO"><span class="term"><code class="constant">-ENXIO</code></span><a class="headerlink" title="Permalink to this term" href="#-ENXIO">¶</a></dt><dd><p>Message cannot be appended to.
+        </p></dd><dt id="-ENOMEM"><span class="term"><code class="constant">-ENOMEM</code></span><a class="headerlink" title="Permalink to this term" href="#-ENOMEM">¶</a></dt><dd><p>Memory allocation failed.</p></dd></dl></div></div><div class="refsect1"><a name="idm214183992288"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes">¶</a></h2><p><code class="function">sd_bus_open_user()</code> and other functions
     described here are available as a shared library, which can be
     compiled and linked to with the
-    <code class="constant">libsystemd-bus</code> <a href="pkg-config.html"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
-    file.</p></div><div class="refsect1"><a name="idm214183687248"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
+    <code class="constant">libsystemd-bus</code> <a href="http://linux.die.net/man/1/pkg-config"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
+    file.</p></div><div class="refsect1"><a name="idm214183988800"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
       <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
       <a href="sd-bus.html"><span class="citerefentry"><span class="refentrytitle">sd-bus</span>(3)</span></a>,
       <a href="sd_bus_new.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_new</span>(3)</span></a>,