]>
Commit | Line | Data |
---|---|---|
9735c644 DDM |
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+ --> | |
5 | ||
6 | <refentry id="sd_bus_call_method" | |
7 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
8 | ||
9 | <refentryinfo> | |
10 | <title>sd_bus_call_method</title> | |
11 | <productname>systemd</productname> | |
12 | </refentryinfo> | |
13 | ||
14 | <refmeta> | |
15 | <refentrytitle>sd_bus_call_method</refentrytitle> | |
16 | <manvolnum>3</manvolnum> | |
17 | </refmeta> | |
18 | ||
19 | <refnamediv> | |
20 | <refname>sd_bus_call_method</refname> | |
21 | <refname>sd_bus_call_method_async</refname> | |
22 | ||
953ee402 DDM |
23 | <refpurpose>Initialize a bus message object and invoke the corresponding D-Bus method call |
24 | </refpurpose> | |
9735c644 DDM |
25 | </refnamediv> |
26 | ||
27 | <refsynopsisdiv> | |
28 | <funcsynopsis> | |
29 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
30 | ||
31 | <funcprototype> | |
32 | <funcdef>int <function>sd_bus_call_method</function></funcdef> | |
33 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
34 | <paramdef>const char *<parameter>destination</parameter></paramdef> | |
35 | <paramdef>const char *<parameter>path</parameter></paramdef> | |
36 | <paramdef>const char *<parameter>interface</parameter></paramdef> | |
37 | <paramdef>const char *<parameter>member</parameter></paramdef> | |
38 | <paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef> | |
39 | <paramdef>sd_bus_message **<parameter>reply</parameter></paramdef> | |
40 | <paramdef>const char *<parameter>types</parameter></paramdef> | |
41 | <paramdef>...</paramdef> | |
42 | </funcprototype> | |
43 | ||
44 | <funcprototype> | |
45 | <funcdef>int <function>sd_bus_call_method_async</function></funcdef> | |
46 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
47 | <paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef> | |
48 | <paramdef>const char *<parameter>destination</parameter></paramdef> | |
49 | <paramdef>const char *<parameter>path</parameter></paramdef> | |
50 | <paramdef>const char *<parameter>interface</parameter></paramdef> | |
51 | <paramdef>const char *<parameter>member</parameter></paramdef> | |
52 | <paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef> | |
53 | <paramdef>void *<parameter>userdata</parameter></paramdef> | |
54 | <paramdef>const char *<parameter>types</parameter></paramdef> | |
55 | <paramdef>...</paramdef> | |
56 | </funcprototype> | |
57 | </funcsynopsis> | |
58 | </refsynopsisdiv> | |
59 | ||
60 | <refsect1> | |
61 | <title>Description</title> | |
62 | ||
953ee402 DDM |
63 | <para><function>sd_bus_call_method()</function> is a convenience function for initializing a |
64 | bus message object and calling the corresponding D-Bus method. It combines the | |
9735c644 DDM |
65 | <citerefentry><refentrytitle>sd_bus_message_new_method_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>, |
66 | <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry> and | |
67 | <citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
68 | functions into a single function call.</para> | |
69 | ||
953ee402 DDM |
70 | <para><function>sd_bus_call_method_async()</function> is a convenience function for initializing |
71 | a bus message object and calling the corresponding D-Bus method asynchronously. It combines the | |
9735c644 DDM |
72 | <citerefentry><refentrytitle>sd_bus_message_new_method_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>, |
73 | <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry> and | |
74 | <citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
75 | functions into a single function call.</para> | |
76 | </refsect1> | |
77 | ||
78 | <refsect1> | |
79 | <title>Return Value</title> | |
80 | ||
953ee402 | 81 | <para>On success, these functions return a non-negative integer. On failure, they return a |
9735c644 DDM |
82 | negative errno-style error code.</para> |
83 | ||
84 | <refsect2 id='errors'> | |
85 | <title>Errors</title> | |
86 | ||
87 | <para>See the man pages of | |
88 | <citerefentry><refentrytitle>sd_bus_message_new_method_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
89 | <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
90 | <citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry> and | |
91 | <citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
92 | for a list of possible errors.</para> | |
93 | </refsect2> | |
94 | </refsect1> | |
95 | ||
96 | <xi:include href="libsystemd-pkgconfig.xml" /> | |
97 | ||
98 | <refsect1> | |
99 | <title>See Also</title> | |
100 | ||
101 | <para> | |
102 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
103 | <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
104 | <citerefentry><refentrytitle>sd_bus_message_new_method_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
105 | <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
106 | <citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
107 | <citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
108 | </para> | |
109 | </refsect1> | |
110 | ||
111 | </refentry> |