From 855ce449eba82c417c005d17aa680aba2048ed8d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 9 Jan 2014 14:02:56 -0500 Subject: device-nodes: move device node specific code to own file In the process, rename udev_encode_string which is poorly named for what it does. It deals specifically with encoding names that udev creates and has its own rules: utf8 is valid but some ascii is not (e.g. path separators), and everything else is simply escaped. Rename it to encode_devnode_name. Adopted for eudev: Anthony G. Basile Signed-off-by: Anthony G. Basile --- src/libudev/utf8.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/libudev/utf8.h') diff --git a/src/libudev/utf8.h b/src/libudev/utf8.h index 380036da18..9d09153c1c 100644 --- a/src/libudev/utf8.h +++ b/src/libudev/utf8.h @@ -21,6 +21,11 @@ #include "macro.h" +char *ascii_is_valid(const char *s) _pure_; + +bool utf8_is_printable(const char* str, size_t length) _pure_; + +char *utf16_to_utf8(const void *s, size_t length); + int utf8_encoded_valid_unichar(const char *str); -int is_utf8_encoding_whitelisted(char c, const char *white); -int udev_encode_string(const char *str, char *str_enc, size_t len); +int utf8_encoded_to_unichar(const char *str); -- cgit v1.2.3-54-g00ecf