chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / man / sd_bus_is_open.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_bus_is_open">
10
11   <refentryinfo>
12     <title>sd_bus_is_open</title>
13     <productname>elogind</productname>
14
15     <authorgroup>
16       <author>
17         <contrib>Developer</contrib>
18         <firstname>Lennart</firstname>
19         <surname>Poettering</surname>
20         <email>lennart@poettering.net</email>
21       </author>
22     </authorgroup>
23   </refentryinfo>
24
25   <refmeta>
26     <refentrytitle>sd_bus_is_open</refentrytitle>
27     <manvolnum>3</manvolnum>
28   </refmeta>
29
30   <refnamediv>
31     <refname>sd_bus_is_open</refname>
32     <refname>sd_bus_is_ready</refname>
33
34     <refpurpose>Check whether the a bus connection is open or ready.</refpurpose>
35   </refnamediv>
36
37   <refsynopsisdiv>
38     <funcsynopsis>
39       <funcsynopsisinfo>#include &lt;elogind/sd-bus.h&gt;</funcsynopsisinfo>
40
41       <funcprototype>
42         <funcdef>int <function>sd_bus_is_open</function></funcdef>
43         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
44       </funcprototype>
45
46       <funcprototype>
47         <funcdef>int <function>sd_bus_is_ready</function></funcdef>
48         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
49       </funcprototype>
50
51     </funcsynopsis>
52   </refsynopsisdiv>
53
54   <refsect1>
55     <title>Description</title>
56
57     <para><function>sd_bus_is_open()</function> checks whether the specified bus connection is open, i.e. in the
58     process of being established, already established or in the process of being torn down. It returns zero when the
59     connection has not been started yet
60     (i.e. <citerefentry><refentrytitle>sd_bus_start</refentrytitle><manvolnum>3</manvolnum></citerefentry> or some
61     equivalent call has not been invoked yet), or is fully terminated again (for example after
62     <citerefentry><refentrytitle>sd_bus_close</refentrytitle><manvolnum>3</manvolnum></citerefentry>), it returns
63     positive otherwise.</para>
64
65     <para><function>sd_bus_is_ready()</function> checks whether the specified connection is fully established,
66     i.e. completed the connection and authentication phases of the protocol and received the
67     <function>Hello()</function> method call response, and is not in the process of being torn down again. It returns
68     zero outside of this state, and positive otherwise. Effectively, this function returns positive while regular
69     messages can be sent or received on the connection.</para>
70
71     <para>To be notified when the connection is fully established, use
72     <citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
73     install a match for the <function>Connected()</function> signal on the
74     <literal>org.freedesktop.DBus.Local</literal> interface. To be notified when the connection is torn down again,
75     install a match for the <function>Disconnected()</function> signal on the
76     <literal>org.freedesktop.DBus.Local</literal> interface.</para>
77   </refsect1>
78
79   <refsect1>
80     <title>Return Value</title>
81
82     <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
83     error code.</para>
84   </refsect1>
85
86   <refsect1>
87     <title>Errors</title>
88
89     <para>Returned errors may indicate the following problems:</para>
90
91     <variablelist>
92       <varlistentry>
93         <term><constant>-ECHILD</constant></term>
94
95         <listitem><para>The bus connection has been created in a different process.</para></listitem>
96       </varlistentry>
97     </variablelist>
98   </refsect1>
99
100   <refsect1>
101     <title>Notes</title>
102
103     <para><function>sd_bus_is_open()</function> and <function>sd_bus_is_ready()</function> are available as
104     a shared library, which can be compiled and linked to with the <constant>libelogind</constant> <citerefentry
105     project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> file.</para>
106   </refsect1>
107
108   <refsect1>
109     <title>See Also</title>
110
111     <para>
112       <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
113       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
114       <citerefentry><refentrytitle>sd_bus_start</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
115       <citerefentry><refentrytitle>sd_bus_close</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
116       <citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>
117     </para>
118   </refsect1>
119
120 </refentry>