man-pages/man3/sd_bus_slot_ref.3.html
2021-03-31 01:06:50 +01:00

172 lines
3.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_SLOT_REF</TITLE>
</HEAD><BODY>
<H1>SD_BUS_SLOT_REF</H1>
Section: sd_bus_slot_ref (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_slot_ref, sd_bus_slot_unref, sd_bus_slot_unrefp, sd_bus_slot_get_bus - Create and destroy references to a bus slot object
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>sd_bus_slot *sd_bus_slot_ref(sd_bus_slot&nbsp;*</B><I>slot</I><B>);</B>
<DT id="2">
<B>sd_bus_slot *sd_bus_slot_unref(sd_bus_slot&nbsp;*</B><I>slot</I><B>);</B>
<DT id="3">
<B>void sd_bus_slot_unrefp(sd_bus_slot&nbsp;**</B><I>slotp</I><B>);</B>
<DT id="4">
<B>sd_bus *sd_bus_slot_get_bus(sd_bus_slot&nbsp;*</B><I>m</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_bus_slot_ref()</B>
<DD>increases the reference counter of
<I>slot</I>
by one.
<P>
<B>sd_bus_slot_unref()</B>
decreases the reference counter of
<I>slot</I>
by one. Once the reference count has dropped to zero, slot object is destroyed and cannot be used anymore, so further calls to
<B>sd_bus_slot_ref()</B>
or
<B>sd_bus_slot_unref()</B>
are illegal.
<P>
<B>sd_bus_slot_unrefp()</B>
is similar to
<B>sd_bus_slot_unref()</B>
but takes a pointer to a pointer to an
<B>sd_bus_slot</B>
object. This call is useful in conjunction with GCC's and LLVM's
m[blue]<B>Clean-up Variable Attribute</B>m[]<FONT SIZE="-2">[1]</FONT>. See
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_new">sd_bus_new</A></B>(3)
for an example how to use the cleanup attribute.
<P>
<B>sd_bus_slot_ref()</B>
and
<B>sd_bus_slot_unref()</B>
execute no operation if the passed in bus object address is
<B>NULL</B>.
<B>sd_bus_slot_unrefp()</B>
will first dereference its argument, which must not be
<B>NULL</B>, and will execute no operation if
<I>that</I>
is
<B>NULL</B>.
<P>
<B>sd_bus_slot_get_bus()</B>
returns the bus object that message
<I>slot</I>
is attached to.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
<B>sd_bus_slot_ref()</B>
always returns the argument.
<P>
<B>sd_bus_slot_unref()</B>
always returns
<B>NULL</B>.
<P>
<B>sd_bus_slot_get_bus()</B>
always returns the bus object.
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_new">sd_bus_new</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_new">sd_bus_message_new</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_slot_new_signal">sd_bus_slot_new_signal</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_call_method_async">sd_bus_call_method_async</A></B>(3)
<A NAME="lbAH">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="5"> 1.<DD>
Clean-up Variable Attribute
<DL COMPACT><DT id="6"><DD>
<A HREF="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="10"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="11"><A HREF="#lbAF">NOTES</A><DD>
<DT id="12"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="13"><A HREF="#lbAH">NOTES</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:55 GMT, March 31, 2021
</BODY>
</HTML>