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 --> 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>See Also</title> 79 80 <para> 81 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 82 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry> 83 </para> 84 </refsect1> 85 86</refentry> 87