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 -->
6 <refentry id="sd_bus_interface_name_is_valid" xmlns:xi="http://www.w3.org/2001/XInclude">
8 <title>sd_bus_interface_name_is_valid</title>
9 <productname>systemd</productname>
13 <refentrytitle>sd_bus_interface_name_is_valid</refentrytitle>
14 <manvolnum>3</manvolnum>
18 <refname>sd_bus_interface_name_is_valid</refname>
19 <refname>sd_bus_service_name_is_valid</refname>
20 <refname>sd_bus_member_name_is_valid</refname>
21 <refname>sd_bus_object_path_is_valid</refname>
23 <refpurpose>Check if a string is a valid bus name or object path</refpurpose>
28 <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
31 <funcdef>int <function>sd_bus_interface_name_is_valid</function></funcdef>
32 <paramdef>const char* <parameter>p</parameter></paramdef>
36 <funcdef>int <function>sd_bus_service_name_is_valid</function></funcdef>
37 <paramdef>const char* <parameter>p</parameter></paramdef>
41 <funcdef>int <function>sd_bus_member_name_is_valid</function></funcdef>
42 <paramdef>const char* <parameter>p</parameter></paramdef>
46 <funcdef>int <function>sd_bus_object_path_is_valid</function></funcdef>
47 <paramdef>const char* <parameter>p</parameter></paramdef>
53 <title>Description</title>
55 <para><function>sd_bus_interface_name_is_valid()</function> checks if a given string
56 <parameter>p</parameter> is a syntactically valid bus interface name. Similarly,
57 <function>sd_bus_service_name_is_valid()</function> checks if the argument is a valid bus service name,
58 <function>sd_bus_member_name_is_valid()</function> checks if the argument is a valid bus interface member
59 name, and <function>sd_bus_object_path_is_valid()</function> checks if the argument is a valid bus object
60 path. Those functions generally check that only allowed characters are used and that the length of the
61 string is within limits.</para>
65 <title>Return Value</title>
67 <para>Those functions return 1 if the argument is a valid interface / service / member name or object
68 path, and 0 if it is not. If the argument is <constant>NULL</constant>, an error is returned.</para>
73 <para>Returned errors may indicate the following problems:</para>
77 <term><constant>-EINVAL</constant></term>
79 <listitem><para>The <parameter>p</parameter> parameter is
80 <constant>NULL</constant>.</para>
82 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
88 <xi:include href="libsystemd-pkgconfig.xml" />
91 <title>History</title>
92 <para><function>sd_bus_interface_name_is_valid()</function>,
93 <function>sd_bus_service_name_is_valid()</function>,
94 <function>sd_bus_member_name_is_valid()</function>, and
95 <function>sd_bus_object_path_is_valid()</function> were added in version 246.</para>
99 <title>See Also</title>
102 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
103 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
104 <citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>