| 1 |
'\" t |
| 2 |
.TH "SD_BUS_INTERFACE_NAME_IS_VALID" "3" "" "systemd 261~rc3" "sd_bus_interface_name_is_valid" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
sd_bus_interface_name_is_valid, sd_bus_service_name_is_valid, sd_bus_member_name_is_valid, sd_bus_object_path_is_valid \- Check if a string is a valid bus name or object path |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.sp |
| 26 |
.ft B |
| 27 |
.nf |
| 28 |
#include <systemd/sd\-bus\&.h> |
| 29 |
.fi |
| 30 |
.ft |
| 31 |
.HP \w'int\ sd_bus_interface_name_is_valid('u |
| 32 |
.BI "int sd_bus_interface_name_is_valid(const\ char*\ " "p" ");" |
| 33 |
.HP \w'int\ sd_bus_service_name_is_valid('u |
| 34 |
.BI "int sd_bus_service_name_is_valid(const\ char*\ " "p" ");" |
| 35 |
.HP \w'int\ sd_bus_member_name_is_valid('u |
| 36 |
.BI "int sd_bus_member_name_is_valid(const\ char*\ " "p" ");" |
| 37 |
.HP \w'int\ sd_bus_object_path_is_valid('u |
| 38 |
.BI "int sd_bus_object_path_is_valid(const\ char*\ " "p" ");" |
| 39 |
.SH "DESCRIPTION" |
| 40 |
.PP |
| 41 |
\fBsd_bus_interface_name_is_valid()\fR |
| 42 |
checks if a given string |
| 43 |
\fIp\fR |
| 44 |
is a syntactically valid bus interface name\&. Similarly, |
| 45 |
\fBsd_bus_service_name_is_valid()\fR |
| 46 |
checks if the argument is a valid bus service name, |
| 47 |
\fBsd_bus_member_name_is_valid()\fR |
| 48 |
checks if the argument is a valid bus interface member name, and |
| 49 |
\fBsd_bus_object_path_is_valid()\fR |
| 50 |
checks if the argument is a valid bus object path\&. Those functions generally check that only allowed characters are used and that the length of the string is within limits\&. |
| 51 |
.SH "RETURN VALUE" |
| 52 |
.PP |
| 53 |
Those functions return 1 if the argument is a valid interface / service / member name or object path, and 0 if it is not\&. If the argument is |
| 54 |
\fBNULL\fR, an error is returned\&. |
| 55 |
.SS "Errors" |
| 56 |
.PP |
| 57 |
Returned errors may indicate the following problems: |
| 58 |
.PP |
| 59 |
\fB\-EINVAL\fR |
| 60 |
.RS 4 |
| 61 |
The |
| 62 |
\fIp\fR |
| 63 |
parameter is |
| 64 |
\fBNULL\fR\&. |
| 65 |
.RE |
| 66 |
.SH "NOTES" |
| 67 |
.PP |
| 68 |
Functions described here are available as a shared library, which can be compiled against and linked to with the |
| 69 |
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1) |
| 70 |
file\&. |
| 71 |
.PP |
| 72 |
The code described here uses |
| 73 |
\fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call |
| 74 |
\fBsetenv\fR(3) |
| 75 |
from a parallel thread\&. It is recommended to only do calls to |
| 76 |
\fBsetenv()\fR |
| 77 |
from an early phase of the program when no other threads have been started\&. |
| 78 |
.SH "HISTORY" |
| 79 |
.PP |
| 80 |
\fBsd_bus_interface_name_is_valid()\fR, |
| 81 |
\fBsd_bus_service_name_is_valid()\fR, |
| 82 |
\fBsd_bus_member_name_is_valid()\fR, and |
| 83 |
\fBsd_bus_object_path_is_valid()\fR |
| 84 |
were added in version 246\&. |
| 85 |
.SH "SEE ALSO" |
| 86 |
.PP |
| 87 |
\fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_call_method\fR(3) |