- if (extract_flags & (WIMLIB_EXTRACT_FLAG_SYMLINK |
- WIMLIB_EXTRACT_FLAG_HARDLINK))
- {
- for_lookup_table_entry(wim->lookup_table,
- lte_free_extracted_file,
- NULL);
+ for (size_t i = 0; i < num_cmds; i++) {
+ int extract_flags = (cmds[i].extract_flags |
+ default_extract_flags);
+ const tchar *target = cmds[i].fs_dest_path;
+ const tchar *wim_source_path = cmds[i].wim_source_path;
+
+ ret = do_wimlib_extract_paths(wim, image, target,
+ &wim_source_path, 1,
+ extract_flags | WIMLIB_EXTRACT_FLAG_FILEMODE,
+ progress_func);
+ if (ret)
+ break;
+ }
+
+ clear_lte_extracted_file(wim, all_flags);
+ return ret;
+}
+
+WIMLIBAPI int
+wimlib_extract_paths(WIMStruct *wim,
+ int image,
+ const tchar *target,
+ const tchar * const *paths,
+ size_t num_paths,
+ int extract_flags,
+ wimlib_progress_func_t progress_func)
+{
+ int ret;
+
+ if (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC)
+ return WIMLIB_ERR_INVALID_PARAM;
+
+ ret = do_wimlib_extract_paths(wim, image, target, paths, num_paths,
+ extract_flags, progress_func);
+ clear_lte_extracted_file(wim, extract_flags);
+ return ret;
+}
+
+WIMLIBAPI int
+wimlib_extract_pathlist(WIMStruct *wim, int image,
+ const tchar *target,
+ const tchar *path_list_file,
+ int extract_flags,
+ wimlib_progress_func_t progress_func)
+{
+ int ret;
+ tchar **paths;
+ size_t num_paths;
+ void *mem;
+
+ ret = read_path_list_file(path_list_file, &paths, &num_paths, &mem);
+ if (ret) {
+ ERROR("Failed to read path list file \"%"TS"\"",
+ path_list_file);
+ return ret;