1:255.16-alt1
[systemd_ALT.git] / man / sd_bus_slot_ref.xml
blob055bf00976836648cf402697c5b6075c059aaa5c
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sd_bus_slot_ref" xmlns:xi="http://www.w3.org/2001/XInclude">
7   <refentryinfo>
8     <title>sd_bus_slot_ref</title>
9     <productname>systemd</productname>
10   </refentryinfo>
12   <refmeta>
13     <refentrytitle>sd_bus_slot_ref</refentrytitle>
14     <manvolnum>3</manvolnum>
15   </refmeta>
17   <refnamediv>
18     <refname>sd_bus_slot_ref</refname>
19     <refname>sd_bus_slot_unref</refname>
20     <refname>sd_bus_slot_unrefp</refname>
22     <refpurpose>Create and destroy references to a bus slot object</refpurpose>
23   </refnamediv>
25   <refsynopsisdiv>
26     <funcsynopsis>
27       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29       <funcprototype>
30         <funcdef>sd_bus_slot *<function>sd_bus_slot_ref</function></funcdef>
31         <paramdef>sd_bus_slot *<parameter>slot</parameter></paramdef>
32       </funcprototype>
34       <funcprototype>
35         <funcdef>sd_bus_slot *<function>sd_bus_slot_unref</function></funcdef>
36         <paramdef>sd_bus_slot *<parameter>slot</parameter></paramdef>
37       </funcprototype>
39       <funcprototype>
40         <funcdef>void <function>sd_bus_slot_unrefp</function></funcdef>
41         <paramdef>sd_bus_slot **<parameter>slotp</parameter></paramdef>
42       </funcprototype>
43     </funcsynopsis>
44   </refsynopsisdiv>
46   <refsect1>
47     <title>Description</title>
49     <para><function>sd_bus_slot_ref()</function> increases the internal reference counter of
50     <parameter>slot</parameter> by one.</para>
52     <para><function>sd_bus_slot_unref()</function> decreases the internal reference counter of
53     <parameter>slot</parameter> by one. Once the reference count has dropped to zero, slot object is
54     destroyed and cannot be used anymore, so further calls to <function>sd_bus_slot_ref()</function>
55     or <function>sd_bus_slot_unref()</function> are illegal.</para>
57     <para><function>sd_bus_slot_unrefp()</function> is similar to
58     <function>sd_bus_slot_unref()</function> but takes a pointer to a pointer to an
59     <type>sd_bus_slot</type> object. This call is useful in conjunction with GCC's and LLVM's <ulink
60     url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up Variable
61     Attribute</ulink>. See
62     <citerefentry><refentrytitle>sd_bus_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>
63     for an example how to use the cleanup attribute.</para>
65     <para><function>sd_bus_slot_ref()</function> and <function>sd_bus_slot_unref()</function>
66     execute no operation if the passed in bus object address is
67     <constant>NULL</constant>. <function>sd_bus_slot_unrefp()</function> will first dereference
68     its argument, which must not be <constant>NULL</constant>, and will execute no operation if
69     <emphasis>that</emphasis> is <constant>NULL</constant>.</para>
70   </refsect1>
72   <refsect1>
73     <title>Return Value</title>
75     <para><function>sd_bus_slot_ref()</function> always returns the argument.</para>
77     <para><function>sd_bus_slot_unref()</function> always returns <constant>NULL</constant>.</para>
78   </refsect1>
80   <xi:include href="libsystemd-pkgconfig.xml" />
82   <refsect1>
83     <title>History</title>
84     <para><function>sd_bus_slot_ref()</function>,
85     <function>sd_bus_slot_unref()</function>, and
86     <function>sd_bus_slot_unrefp()</function> were added in version 240.</para>
87   </refsect1>
89   <refsect1>
90     <title>See Also</title>
92     <para>
93       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
94       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
95       <citerefentry><refentrytitle>sd_bus_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
96       <citerefentry><refentrytitle>sd_bus_message_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
97       <citerefentry><refentrytitle>sd_bus_call_method_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>
98     </para>
99   </refsect1>
101 </refentry>