From: Zbigniew Jędrzejewski-Szmek Date: Wed, 8 Jan 2014 04:05:17 +0000 (-0500) Subject: man: document label escaping functions X-Git-Tag: v209~505 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=d30ec1f5df99f18312b4b920b7e62b832387dcc1 man: document label escaping functions --- diff --git a/Makefile-man.am b/Makefile-man.am index 52e62f144..602c90abf 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -23,6 +23,7 @@ MANPAGES += \ man/sd_bus_creds_get_pid.3 \ man/sd_bus_creds_new_from_pid.3 \ man/sd_bus_error.3 \ + man/sd_bus_label_escape.3 \ man/sd_bus_message_get_cookie.3 \ man/sd_bus_new.3 \ man/sd_bus_open_user.3 \ @@ -177,6 +178,7 @@ MANPAGES_ALIAS += \ man/sd_bus_error_set_const.3 \ man/sd_bus_error_set_errno.3 \ man/sd_bus_error_set_errnof.3 \ + man/sd_bus_label_unescape.3 \ man/sd_bus_message_get_reply_cookie.3 \ man/sd_bus_open_system.3 \ man/sd_bus_open_system_container.3 \ @@ -323,6 +325,7 @@ man/sd_bus_error_set.3: man/sd_bus_error.3 man/sd_bus_error_set_const.3: man/sd_bus_error.3 man/sd_bus_error_set_errno.3: man/sd_bus_error.3 man/sd_bus_error_set_errnof.3: man/sd_bus_error.3 +man/sd_bus_label_unescape.3: man/sd_bus_label_escape.3 man/sd_bus_message_get_reply_cookie.3: man/sd_bus_message_get_cookie.3 man/sd_bus_open_system.3: man/sd_bus_open_user.3 man/sd_bus_open_system_container.3: man/sd_bus_open_user.3 @@ -599,6 +602,9 @@ man/sd_bus_error_set_errno.html: man/sd_bus_error.html man/sd_bus_error_set_errnof.html: man/sd_bus_error.html $(html-alias) +man/sd_bus_label_unescape.html: man/sd_bus_label_escape.html + $(html-alias) + man/sd_bus_message_get_reply_cookie.html: man/sd_bus_message_get_cookie.html $(html-alias) @@ -1330,6 +1336,7 @@ EXTRA_DIST += \ man/sd_bus_creds_get_pid.xml \ man/sd_bus_creds_new_from_pid.xml \ man/sd_bus_error.xml \ + man/sd_bus_label_escape.xml \ man/sd_bus_message_get_cookie.xml \ man/sd_bus_new.xml \ man/sd_bus_open_user.xml \ diff --git a/man/sd_bus_label_escape.xml b/man/sd_bus_label_escape.xml new file mode 100644 index 000000000..c868c3f2f --- /dev/null +++ b/man/sd_bus_label_escape.xml @@ -0,0 +1,111 @@ + + + + + + + + + sd_bus_label_escape + systemd + + + + A monkey with a typewriter + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_bus_label_escape + 3 + + + + sd_bus_label_escape + sd_bus_label_unescape + + Escape D-Bus object path special characters + + + + + #include <systemd/sd-bus.h> + + + char* sd_bus_label_escape + const char* s + + + + char* sd_bus_label_unescape + const char* f + + + + + + Description + + sd_bus_label_escape() takes a + NUL-terminated string as a argument. It will + replace all characters which are invalid in a D-Bus object path by + _ and a hexadecimal number. As a special case, + the empty string will be replaced by a lone _. + sd_bus_label_unescape() can be used to + reverse this process. + + + + Return Value + + On success, a new NUL-terminated string + will be returned. It must be + free3d + by the caller. If a memory allocation failure occurs, + NULL will be returned. + + + + + Notes + + sd_bus_label_escape() and + sd_bus_label_unescape() are available as a + shared library, which can be compiled and linked to with the + libsystemd-bus pkg-config1 + file. + + + + See Also + + + systemd1, + sd-bus3, + free3 + + + +