| 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.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="sd_bus_get_current_handler" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 7 |
|
| 8 |
<refentryinfo> |
| 9 |
<title>sd_bus_get_current_handler</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>sd_bus_get_current_handler</refentrytitle> |
| 15 |
<manvolnum>3</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>sd_bus_get_current_handler</refname> |
| 20 |
<refname>sd_bus_get_current_message</refname> |
| 21 |
<refname>sd_bus_get_current_slot</refname> |
| 22 |
<refname>sd_bus_get_current_userdata</refname> |
| 23 |
|
| 24 |
<refpurpose>Query information of the callback a bus object is currently running</refpurpose> |
| 25 |
</refnamediv> |
| 26 |
|
| 27 |
<refsynopsisdiv> |
| 28 |
<funcsynopsis> |
| 29 |
<funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> |
| 30 |
|
| 31 |
<xi:include href="sd_bus_add_match.xml" xpointer="sd_bus_message_handler_t"/> |
| 32 |
|
| 33 |
<funcprototype> |
| 34 |
<funcdef>sd_bus_message_handler_t <function>sd_bus_get_current_handler</function></funcdef> |
| 35 |
<paramdef>sd_bus *<parameter>bus</parameter></paramdef> |
| 36 |
</funcprototype> |
| 37 |
|
| 38 |
<funcprototype> |
| 39 |
<funcdef>sd_bus_message* <function>sd_bus_get_current_message</function></funcdef> |
| 40 |
<paramdef>sd_bus *<parameter>bus</parameter></paramdef> |
| 41 |
</funcprototype> |
| 42 |
|
| 43 |
<funcprototype> |
| 44 |
<funcdef>sd_bus_slot* <function>sd_bus_get_current_slot</function></funcdef> |
| 45 |
<paramdef>sd_bus *<parameter>bus</parameter></paramdef> |
| 46 |
</funcprototype> |
| 47 |
|
| 48 |
<funcprototype> |
| 49 |
<funcdef>void* <function>sd_bus_get_current_userdata</function></funcdef> |
| 50 |
<paramdef>sd_bus *<parameter>bus</parameter></paramdef> |
| 51 |
</funcprototype> |
| 52 |
</funcsynopsis> |
| 53 |
</refsynopsisdiv> |
| 54 |
|
| 55 |
<refsect1> |
| 56 |
<title>Description</title> |
| 57 |
|
| 58 |
<para>Whenever sd-bus is about to invoke a user-supplied callback function, it stores the |
| 59 |
current callback, D-Bus message, slot and userdata pointer and allows these to be queried via |
| 60 |
<function>sd_bus_get_current_handler()</function>, |
| 61 |
<function>sd_bus_get_current_message()</function>, |
| 62 |
<function>sd_bus_get_current_slot()</function> and |
| 63 |
<function>sd_bus_get_current_userdata()</function>, respectively. If <parameter>bus</parameter> |
| 64 |
cannot be resolved or if execution does not reside in a user-supplied callback of |
| 65 |
<parameter>bus</parameter>, these functions return <constant>NULL</constant>.</para> |
| 66 |
</refsect1> |
| 67 |
|
| 68 |
<refsect1> |
| 69 |
<title>Return Value</title> |
| 70 |
|
| 71 |
<para>On success, these functions return the requested object. On failure, they return |
| 72 |
<constant>NULL</constant>.</para> |
| 73 |
</refsect1> |
| 74 |
|
| 75 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 76 |
|
| 77 |
<refsect1> |
| 78 |
<title>History</title> |
| 79 |
<para><function>sd_bus_get_current_handler()</function>, |
| 80 |
<function>sd_bus_get_current_message()</function>, |
| 81 |
<function>sd_bus_get_current_slot()</function>, and |
| 82 |
<function>sd_bus_get_current_userdata()</function> were added in version 221.</para> |
| 83 |
</refsect1> |
| 84 |
|
| 85 |
<refsect1> |
| 86 |
<title>See Also</title> |
| 87 |
|
| 88 |
<para><simplelist type="inline"> |
| 89 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 90 |
<member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 91 |
</simplelist></para> |
| 92 |
</refsect1> |
| 93 |
|
| 94 |
</refentry> |