| 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.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="sd_bus_interface_name_is_valid" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 7 |
<refentryinfo> |
| 8 |
<title>sd_bus_interface_name_is_valid</title> |
| 9 |
<productname>systemd</productname> |
| 10 |
</refentryinfo> |
| 11 |
|
| 12 |
<refmeta> |
| 13 |
<refentrytitle>sd_bus_interface_name_is_valid</refentrytitle> |
| 14 |
<manvolnum>3</manvolnum> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 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> |
| 22 |
|
| 23 |
<refpurpose>Check if a string is a valid bus name or object path</refpurpose> |
| 24 |
</refnamediv> |
| 25 |
|
| 26 |
<refsynopsisdiv> |
| 27 |
<funcsynopsis> |
| 28 |
<funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> |
| 29 |
|
| 30 |
<funcprototype> |
| 31 |
<funcdef>int <function>sd_bus_interface_name_is_valid</function></funcdef> |
| 32 |
<paramdef>const char* <parameter>p</parameter></paramdef> |
| 33 |
</funcprototype> |
| 34 |
|
| 35 |
<funcprototype> |
| 36 |
<funcdef>int <function>sd_bus_service_name_is_valid</function></funcdef> |
| 37 |
<paramdef>const char* <parameter>p</parameter></paramdef> |
| 38 |
</funcprototype> |
| 39 |
|
| 40 |
<funcprototype> |
| 41 |
<funcdef>int <function>sd_bus_member_name_is_valid</function></funcdef> |
| 42 |
<paramdef>const char* <parameter>p</parameter></paramdef> |
| 43 |
</funcprototype> |
| 44 |
|
| 45 |
<funcprototype> |
| 46 |
<funcdef>int <function>sd_bus_object_path_is_valid</function></funcdef> |
| 47 |
<paramdef>const char* <parameter>p</parameter></paramdef> |
| 48 |
</funcprototype> |
| 49 |
</funcsynopsis> |
| 50 |
</refsynopsisdiv> |
| 51 |
|
| 52 |
<refsect1> |
| 53 |
<title>Description</title> |
| 54 |
|
| 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> |
| 62 |
</refsect1> |
| 63 |
|
| 64 |
<refsect1> |
| 65 |
<title>Return Value</title> |
| 66 |
|
| 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> |
| 69 |
|
| 70 |
<refsect2> |
| 71 |
<title>Errors</title> |
| 72 |
|
| 73 |
<para>Returned errors may indicate the following problems:</para> |
| 74 |
|
| 75 |
<variablelist> |
| 76 |
<varlistentry> |
| 77 |
<term><constant>-EINVAL</constant></term> |
| 78 |
|
| 79 |
<listitem><para>The <parameter>p</parameter> parameter is |
| 80 |
<constant>NULL</constant>.</para></listitem> |
| 81 |
</varlistentry> |
| 82 |
</variablelist> |
| 83 |
</refsect2> |
| 84 |
</refsect1> |
| 85 |
|
| 86 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 87 |
|
| 88 |
<refsect1> |
| 89 |
<title>History</title> |
| 90 |
<para><function>sd_bus_interface_name_is_valid()</function>, |
| 91 |
<function>sd_bus_service_name_is_valid()</function>, |
| 92 |
<function>sd_bus_member_name_is_valid()</function>, and |
| 93 |
<function>sd_bus_object_path_is_valid()</function> were added in version 246.</para> |
| 94 |
</refsect1> |
| 95 |
|
| 96 |
<refsect1> |
| 97 |
<title>See Also</title> |
| 98 |
|
| 99 |
<para><simplelist type="inline"> |
| 100 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 101 |
<member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 102 |
<member><citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 103 |
</simplelist></para> |
| 104 |
</refsect1> |
| 105 |
|
| 106 |
</refentry> |