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_message_verify_type" xmlns:xi="http://www.w3.org/2001/XInclude"> 7 <refentryinfo> 8 <title>sd_bus_message_verify_type</title> 9 <productname>systemd</productname> 10 </refentryinfo> 11 12 <refmeta> 13 <refentrytitle>sd_bus_message_verify_type</refentrytitle> 14 <manvolnum>3</manvolnum> 15 </refmeta> 16 17 <refnamediv> 18 <refname>sd_bus_message_verify_type</refname> 19 20 <refpurpose>Check if the message has specified type at the current location</refpurpose> 21 </refnamediv> 22 23 <refsynopsisdiv> 24 <funcsynopsis> 25 <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> 26 27 <funcprototype> 28 <funcdef>int sd_bus_message_verify_type</funcdef> 29 <paramdef>sd_bus_message *<parameter>m</parameter></paramdef> 30 <paramdef>char <parameter>type</parameter></paramdef> 31 <paramdef>const char* <parameter>contents</parameter></paramdef> 32 </funcprototype> 33 </funcsynopsis> 34 </refsynopsisdiv> 35 36 <refsect1> 37 <title>Description</title> 38 39 <para><function>sd_bus_message_verify_type()</function> checks if the complete type at the 40 current location in the message <parameter>m</parameter> matches the specified 41 <parameter>type</parameter> and <parameter>contents</parameter>. If non-zero, parameter 42 <parameter>type</parameter> must be one of the types specified in 43 <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>1</manvolnum></citerefentry>. 44 If non-null, parameter <parameter>contents</parameter> must be a valid sequence of complete 45 types. If both <parameter>type</parameter> and <parameter>contents</parameter> are specified 46 <parameter>type</parameter> must be a container type.</para> 47 48 <para>If <parameter>type</parameter> is specified, the type in the message must match. If 49 <parameter>contents</parameter> is specified, the type in the message must be a container type 50 with this signature.</para> 51 </refsect1> 52 53 <refsect1> 54 <title>Return Value</title> 55 56 <para>On success, this call returns true if the type matches and zero if not (the message 57 <parameter>m</parameter> contains different data or the end of the message has been reached). On 58 failure, it returns a negative errno-style error code.</para> 59 60 <refsect2> 61 <title>Errors</title> 62 63 <para>Returned errors may indicate the following problems:</para> 64 65 <variablelist> 66 67 <varlistentry> 68 <term><constant>-EINVAL</constant></term> 69 70 <listitem><para><parameter>m</parameter> or both <parameter>type</parameter> and 71 <parameter>contents</parameter> are <constant>NULL</constant>.</para> 72 73 <para>Arguments do not satisfy other constraints listed above.</para> 74 </listitem> 75 </varlistentry> 76 77 <varlistentry> 78 <term><constant>-EPERM</constant></term> 79 80 <listitem><para>Message <parameter>m</parameter> is not sealed. 81 </para></listitem> 82 </varlistentry> 83 </variablelist> 84 </refsect2> 85 </refsect1> 86 87 <xi:include href="libsystemd-pkgconfig.xml" /> 88 89 <refsect1> 90 <title>See Also</title> 91 92 <para> 93 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 94 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 95 <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry> 96 </para> 97 </refsect1> 98 99</refentry> 100