/* Converts a string in the UTF-8 encoding to a newly allocated string in the
* UTF-16 encoding. */
-char *utf8_to_utf16(const char *utf8_str, size_t utf8_len,
- size_t *utf16_len_ret)
+char *utf8_to_utf16(const char *utf8_str, size_t utf8_len,
+ size_t *utf16_len_ret)
{
if (cd_utf8_to_utf16 == (iconv_t)(-1)) {
cd_utf8_to_utf16 = iconv_open("UTF-16LE", "UTF-8");
return p + 1;
}
+const char *path_stream_name(const char *path)
+{
+ const char *base = path_basename(path);
+ const char *stream_name = strchr(base, ':');
+ if (!stream_name)
+ return NULL;
+ else
+ return stream_name + 1;
+}
+
/*
* Splits a file path into the part before the first '/', or the entire name if
* there is no '/', and the part after the first sequence of '/' characters.