173 lines
4.8 KiB
HTML
173 lines
4.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_BUS_SLOT_SET_DESTROY_CALLBACK</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_BUS_SLOT_SET_DESTROY_CALLBACK</H1>
|
|
Section: sd_bus_slot_set_destroy_callback (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_bus_slot_set_destroy_callback, sd_bus_slot_get_destroy_callback, sd_bus_track_set_destroy_callback, sd_bus_track_get_destroy_callback, sd_bus_destroy_t - Define the callback function for resource cleanup.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>typedef int (*sd_bus_destroy_t)(void *</B><I>userdata</I><B>);</B>
|
|
|
|
<DT id="2">
|
|
<B>int sd_bus_slot_set_destroy_callback(sd_bus_slot *</B><I>slot</I><B>, sd_bus_destroy_t </B><I>callback</I><B>);</B>
|
|
|
|
<DT id="3">
|
|
<B>int sd_bus_slot_get_destroy_callback(sd_bus_slot *</B><I>slot</I><B>, sd_bus_destroy_t *</B><I>callback</I><B>);</B>
|
|
|
|
<DT id="4">
|
|
<B>int sd_bus_track_set_destroy_callback(sd_bus_track *</B><I>track</I><B>, sd_bus_destroy_t </B><I>callback</I><B>);</B>
|
|
|
|
<DT id="5">
|
|
<B>int sd_bus_track_get_destroy_callback(sd_bus_track *</B><I>track</I><B>, sd_bus_destroy_t *</B><I>callback</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_bus_slot_set_destroy_callback()</B>
|
|
<DD>sets
|
|
<I>callback</I>
|
|
as the callback function to be called right before the bus slot object
|
|
<I>slot</I>
|
|
is deallocated. The
|
|
<I>userdata</I>
|
|
pointer from the slot object will be passed as the
|
|
<I>userdata</I>
|
|
parameter. This pointer can be set by an argument to the constructor functions, see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_add_match">sd_bus_add_match</A></B>(3), or directly, see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_slot_set_userdata">sd_bus_slot_set_userdata</A></B>(3). This callback function is called even if
|
|
<I>userdata</I>
|
|
is
|
|
<B>NULL</B>. Note that this callback is invoked at a time where the bus slot object itself is already invalidated, and executing operations or taking new references to the bus slot object is not permissible.
|
|
<P>
|
|
|
|
<B>sd_bus_slot_get_destroy_callback()</B>
|
|
returns the current callback for
|
|
<I>slot</I>
|
|
in the
|
|
<I>callback</I>
|
|
parameter.
|
|
<P>
|
|
|
|
<B>sd_bus_track_set_destroy_callback()</B>
|
|
and
|
|
<B>sd_bus_track_get_destroy_callback()</B>
|
|
provide equivalent functionality for the
|
|
<I>userdata</I>
|
|
pointer associated with bus peer tracking objects. For details about bus peer tracking objects, see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_track_new">sd_bus_track_new</A></B>(3).
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
On success,
|
|
<B>sd_bus_slot_set_destroy_callback()</B>
|
|
and
|
|
<B>sd_bus_track_set_destroy_callback()</B>
|
|
return 0 or a positive integer. On failure, they return a negative errno-style error code.
|
|
<P>
|
|
|
|
<B>sd_bus_slot_get_destroy_callback()</B>
|
|
and
|
|
<B>sd_bus_track_get_destroy_callback()</B>
|
|
return positive if the destroy callback function is set, 0 if not. On failure, they return a negative errno-style error code.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<P>
|
|
|
|
Returned errors may indicate the following problems:
|
|
<P>
|
|
|
|
<B>-EINVAL</B>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
The
|
|
<I>slot</I>
|
|
or
|
|
<I>track</I>
|
|
parameter is
|
|
<B>NULL</B>.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </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> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAH"> </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_slot_set_floating">sd_bus_slot_set_floating</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_add_match">sd_bus_add_match</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_track_new">sd_bus_track_new</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_slot_set_userdata">sd_bus_slot_set_userdata</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_track_set_userdata">sd_bus_track_set_userdata</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </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>
|
|
<DL>
|
|
<DT id="11"><A HREF="#lbAF">Errors</A><DD>
|
|
</DL>
|
|
<DT id="12"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="13"><A HREF="#lbAH">SEE ALSO</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>
|