1<?xml version='1.0'?> <!--*-nxml-*-->
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_message_get_signature" xmlns:xi="http://www.w3.org/2001/XInclude">
7  <refentryinfo>
8    <title>sd_bus_message_get_signature</title>
9    <productname>systemd</productname>
10  </refentryinfo>
11
12  <refmeta>
13    <refentrytitle>sd_bus_message_get_signature</refentrytitle>
14    <manvolnum>3</manvolnum>
15  </refmeta>
16
17  <refnamediv>
18    <refname>sd_bus_message_get_signature</refname>
19    <refname>sd_bus_message_is_empty</refname>
20    <refname>sd_bus_message_has_signature</refname>
21
22    <refpurpose>Query bus message signature</refpurpose>
23  </refnamediv>
24
25  <refsynopsisdiv>
26    <funcsynopsis>
27      <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
28
29      <funcprototype>
30        <funcdef>const char* <function>sd_bus_message_get_signature</function></funcdef>
31        <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
32        <paramdef>int <parameter>complete</parameter></paramdef>
33      </funcprototype>
34
35      <funcprototype>
36        <funcdef>int <function>sd_bus_message_is_empty</function></funcdef>
37        <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
38      </funcprototype>
39
40      <funcprototype>
41        <funcdef>int <function>sd_bus_message_has_signature</function></funcdef>
42        <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
43        <paramdef>const char *<parameter>signature</parameter></paramdef>
44      </funcprototype>
45    </funcsynopsis>
46
47  </refsynopsisdiv>
48
49  <refsect1>
50    <title>Description</title>
51
52    <para><function>sd_bus_message_get_signature()</function> returns the signature of message
53    <parameter>message</parameter>. If <parameter>complete</parameter> is true, the signature of the
54    whole message is returned, and just the signature of the currently open container otherwise.
55    </para>
56
57    <para><function>sd_bus_message_is_empty()</function> returns true if the message is empty,
58    i.e. when its signature is empty.</para>
59
60    <para><function>sd_bus_message_has_signature()</function> returns true if the signature of the
61    message <parameter>message</parameter> matches given <parameter>signature</parameter>. Parameter
62    <parameter>signature</parameter> may be <constant>NULL</constant>, this is treated the same as
63    an empty string, which is equivalent to calling <function>sd_bus_message_is_empty()</function>.
64    </para>
65</refsect1>
66
67  <refsect1>
68    <title>Return Value</title>
69
70    <para>On success, <function>sd_bus_message_get_signature()</function> returns
71    the signature, and <constant>NULL</constant> on error.</para>
72
73    <para>The other functions return 0 or a positive integer on success. On failure, they return a
74    negative errno-style error code.</para>
75
76    <refsect2>
77      <title>Errors</title>
78
79      <para>Returned errors may indicate the following problems:</para>
80
81      <variablelist>
82        <varlistentry>
83          <term><constant>-EINVAL</constant></term>
84
85          <listitem><para>The <parameter>message</parameter> parameter is <constant>NULL</constant>.
86          </para></listitem>
87        </varlistentry>
88
89        <varlistentry>
90          <term><constant>NULL</constant></term>
91
92          <listitem><para>The <parameter>message</parameter> parameter is <constant>NULL</constant>.
93          </para></listitem>
94        </varlistentry>
95      </variablelist>
96    </refsect2>
97  </refsect1>
98
99  <xi:include href="libsystemd-pkgconfig.xml" />
100
101  <refsect1>
102    <title>See Also</title>
103
104    <para>
105      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
106      <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
107      <citerefentry><refentrytitle>sd_bus_message_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>
108    </para>
109  </refsect1>
110
111</refentry>
112