Systemd/src/libudev/libudev-util.c

28 lines
804 B
C
Raw Permalink Normal View History

/* SPDX-License-Identifier: LGPL-2.1-or-later */
2008-08-27 22:02:41 +02:00
#include "device-nodes.h"
#include "libudev-util.h"
2008-08-27 22:02:41 +02:00
/**
* SECTION:libudev-util
* @short_description: utils
2012-04-20 03:25:36 +02:00
*
* Utilities useful when dealing with devices and device node names.
*/
2008-11-05 21:49:52 +01:00
/**
* udev_util_encode_string:
2008-11-05 21:49:52 +01:00
* @str: input string to be encoded
* @str_enc: output string to store the encoded input string
* @len: maximum size of the output string, which may be
* four times as long as the input string
*
* Encode all potentially unsafe characters of a string to the
* corresponding 2 char hex value prefixed by '\x'.
2008-11-05 21:49:52 +01:00
*
* Returns: 0 if the entire string was copied, non-zero otherwise.
**/
_public_ int udev_util_encode_string(const char *str, char *str_enc, size_t len) {
return encode_devnode_name(str, str_enc, len);
2008-11-05 21:49:52 +01:00
}