]> wimlib.net Git - wimlib/blobdiff - src/extract.c
Add WIMLIB_EXTRACT_FLAG_WIMBOOT
[wimlib] / src / extract.c
index 623fbf7ccfaaa9717112208081f8fa9fa1302b35..6512917c0c5ed9df4afe7c0addf23243151033c2 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
- * Copyright (C) 2012, 2013 Eric Biggers
+ * Copyright (C) 2012, 2013, 2014 Eric Biggers
  *
  * This file is part of wimlib, a library for working with WIM files.
  *
@@ -94,7 +94,8 @@
         WIMLIB_EXTRACT_FLAG_GLOB_PATHS                 |       \
         WIMLIB_EXTRACT_FLAG_STRICT_GLOB                |       \
         WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES              |       \
-        WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE)
+        WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE  |       \
+        WIMLIB_EXTRACT_FLAG_WIMBOOT)
 
 static bool
 dentry_in_list(const struct wim_dentry *dentry)
@@ -1658,17 +1659,11 @@ dentry_reset_extraction_list_node(struct wim_dentry *dentry)
        dentry->extraction_list = (struct list_head){NULL, NULL};
 }
 
-static void
-dentry_delete_from_list(struct wim_dentry *dentry)
+static int
+dentry_delete_from_list(struct wim_dentry *dentry, void *_ignore)
 {
        list_del(&dentry->extraction_list);
        dentry_reset_extraction_list_node(dentry);
-}
-
-static int
-do_dentry_delete_from_list(struct wim_dentry *dentry, void *_ignore)
-{
-       dentry_delete_from_list(dentry);
        return 0;
 }
 
@@ -1795,8 +1790,8 @@ dentry_calculate_extraction_name(struct wim_dentry *dentry,
        if (!ctx->ops->supports_case_sensitive_filenames)
        {
                struct wim_dentry *other;
-               list_for_each_entry(other, &dentry->case_insensitive_conflict_list,
-                                   case_insensitive_conflict_list)
+               list_for_each_entry(other, &dentry->d_ci_conflict_list,
+                                   d_ci_conflict_list)
                {
                        if (dentry_in_list(other)) {
                                if (ctx->extract_flags &
@@ -1885,7 +1880,7 @@ out_replace:
        return 0;
 
 skip_dentry:
-       for_dentry_in_tree(dentry, do_dentry_delete_from_list, NULL);
+       for_dentry_in_tree(dentry, dentry_delete_from_list, NULL);
        return 0;
 }
 
@@ -2515,7 +2510,7 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
        INIT_LIST_HEAD(&ctx.stream_list);
        ret = dentry_list_ref_streams(&dentry_list, &ctx);
        if (ret)
-               goto out_finish_or_abort_extract;
+               goto out_destroy_stream_list;
 
        if (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) {
                /* When extracting from a pipe, the number of bytes of data to
@@ -2750,6 +2745,13 @@ check_extract_flags(const WIMStruct *wim, int *extract_flags_p)
        }
 #endif
 
+#ifndef __WIN32__
+       if (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) {
+               ERROR("WIMBoot extraction is only supported on Windows!");
+               return WIMLIB_ERR_UNSUPPORTED;
+       }
+#endif
+
        if ((extract_flags & (WIMLIB_EXTRACT_FLAG_RPFIX |
                              WIMLIB_EXTRACT_FLAG_NORPFIX |
                              WIMLIB_EXTRACT_FLAG_IMAGEMODE)) ==