]> wimlib.net Git - wimlib/blobdiff - src/util.c
compiles (IN PROGRESS)
[wimlib] / src / util.c
index 474c6f108931906d1bc782d202976507f035cb8d..e14ddd403f64eef883594f7a805ffec19c1e8a15 100644 (file)
@@ -159,6 +159,8 @@ static const char *error_strings[] = {
                        "identify a WIM file",
        [WIMLIB_ERR_NO_FILENAME] 
                = "The WIM is not identified with a filename",
+       [WIMLIB_ERR_NTFS_3G]
+               = "NTFS-3g encountered an error (check errno)",
        [WIMLIB_ERR_OPEN] 
                = "Failed to open a file",
        [WIMLIB_ERR_OPENDIR] 
@@ -293,8 +295,8 @@ static iconv_t cd_utf8_to_utf16 = (iconv_t)(-1);
 
 /* 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");
@@ -426,6 +428,16 @@ const char *path_basename(const char *path)
        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.