]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: Add sd_bus_send_to docs
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 23 Apr 2020 18:40:30 +0000 (20:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Apr 2020 20:38:44 +0000 (22:38 +0200)
man/rules/meson.build
man/sd-bus.xml
man/sd_bus_send.xml

index 9b2e102dd15b6401b61fc660e03ab0d6ebd4ac68..4bcb273810a340b67e46c19fe49762175599e527 100644 (file)
@@ -388,7 +388,7 @@ manpages = [
    'sd_bus_release_name_async',
    'sd_bus_request_name_async'],
   ''],
- ['sd_bus_send', '3', [], ''],
+ ['sd_bus_send', '3', ['sd_bus_send_to'], ''],
  ['sd_bus_set_address', '3', ['sd_bus_get_address', 'sd_bus_set_exec'], ''],
  ['sd_bus_set_close_on_exit', '3', ['sd_bus_get_close_on_exit'], ''],
  ['sd_bus_set_connected_signal', '3', ['sd_bus_get_connected_signal'], ''],
index 590998941add26472ca94f81cdf85f02d0b1274a..c6ceef95fef437a57edfe4f4842537153dbfbf6d 100644 (file)
 <citerefentry><refentrytitle>sd_bus_reply_method_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_request_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>sd_bus_send_to</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_address</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_allow_interactive_authorization</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_bus_client</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
index 659fa2a86ce7c5b2fb676f06d2844b6d50787f4b..2cdf436db2bc981857f798cbbd3e4c45322f9ce6 100644 (file)
@@ -18,6 +18,7 @@
 
   <refnamediv>
     <refname>sd_bus_send</refname>
+    <refname>sd_bus_send_to</refname>
 
     <refpurpose>Queue a D-Bus message for transfer</refpurpose>
   </refnamediv>
         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
         <paramdef>uint64_t *<parameter>cookie</parameter></paramdef>
       </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_send_to</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
+        <paramdef>const char *<parameter>destination</parameter></paramdef>
+        <paramdef>uint64_t *<parameter>cookie</parameter></paramdef>
+      </funcprototype>
     </funcsynopsis>
   </refsynopsisdiv>
 
   <refsect1>
     <title>Description</title>
 
-    <para><function>sd_bus_send()</function> queues the bus message object <parameter>m</parameter>
-    for transfer. If <parameter>bus</parameter> is <constant>NULL</constant>, the bus that
-    <parameter>m</parameter> is attached to is used. <parameter>bus</parameter> only needs to be set
-    when the message is sent to a different bus than the one it's attached to, for example when
-    forwarding messages. If the output parameter <parameter>cookie</parameter> is not
-    <constant>NULL</constant>, it is set to the message identifier. This value can later be used to
-    match incoming replies to their corresponding messages. If <parameter>cookie</parameter> is set
-    to <constant>NULL</constant> and the message is not sealed, <function>sd_bus_send()</function>
-    assumes the message <parameter>m</parameter> doesn't expect a reply and adds the necessary
-    headers to indicate this.</para>
+    <para><function>sd_bus_send()</function> queues the bus message object <parameter>m</parameter> for
+    transfer. If <parameter>bus</parameter> is <constant>NULL</constant>, the bus that
+    <parameter>m</parameter> is attached to is used. <parameter>bus</parameter> only needs to be set when the
+    message is sent to a different bus than the one it's attached to, for example when forwarding messages.
+    If the output parameter <parameter>cookie</parameter> is not <constant>NULL</constant>, it is set to the
+    message identifier. This value can later be used to match incoming replies to their corresponding
+    messages. If <parameter>cookie</parameter> is set to <constant>NULL</constant> and the message is not
+    sealed, <function>sd_bus_send()</function> assumes the message <parameter>m</parameter> doesn't expect a
+    reply and adds the necessary headers to indicate this.</para>
 
     <para>Note that in most scenarios, <function>sd_bus_send()</function> should not be called
     directly. Instead, use higher level functions such as
     <citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
     <citerefentry><refentrytitle>sd_bus_reply_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>
     which call <function>sd_bus_send()</function> internally.</para>
+
+    <para><function>sd_bus_send_to()</function> is a shorthand for sending a message to a specific
+    destination. It's main use case is to simplify sending unicast signal messages (signals that only have a
+    single receiver). It's behavior is similar to calling
+    <citerefentry><refentrytitle>sd_bus_message_set_destination</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+    followed by calling <function>sd_bus_send()</function>.</para>
   </refsect1>
 
   <refsect1>
     <title>Return Value</title>
 
-    <para>On success, this function returns a non-negative integer. On failure, it returns a
-    negative errno-style error code.</para>
+    <para>On success, these functions return a non-negative integer. On failure, they return a negative
+    errno-style error code.</para>
 
     <refsect2 id='errors'>
       <title>Errors</title>
@@ -85,8 +99,8 @@
         <varlistentry>
           <term><constant>-ECHILD</constant></term>
 
-          <listitem><para>The bus connection was allocated in a parent process and is being reused
-          in a child process after <function>fork()</function>.</para></listitem>
+          <listitem><para>The bus connection was allocated in a parent process and is being reused in a child
+          process after <function>fork()</function>.</para></listitem>
         </varlistentry>
 
         <varlistentry>
       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>sd_bus_message_set_destination</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>sd_bus_reply_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>sd_bus_send_to</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+      <citerefentry><refentrytitle>sd_bus_reply_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>
     </para>
   </refsect1>