]> wimlib.net Git - wimlib/blobdiff - src/reference.c
new internal image deletion helper
[wimlib] / src / reference.c
index c423bdd7ada1d0d669fbca9e8e3dae8e64077828..9e7eb6090d815e81ed1a678415e42f906d9172bf 100644 (file)
@@ -7,20 +7,18 @@
 /*
  * Copyright (C) 2013 Eric Biggers
  *
- * This file is part of wimlib, a library for working with WIM files.
+ * This file is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option) any
+ * later version.
  *
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * This file is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -155,8 +153,7 @@ reference_resource_paths(WIMStruct *wim,
                         const tchar * const *resource_wimfiles,
                         unsigned num_resource_wimfiles,
                         int ref_flags,
-                        int open_flags,
-                        wimlib_progress_func_t progress_func)
+                        int open_flags)
 {
        WIMStruct **resource_wims;
        unsigned i;
@@ -169,8 +166,11 @@ reference_resource_paths(WIMStruct *wim,
        for (i = 0; i < num_resource_wimfiles; i++) {
                DEBUG("Referencing resources from path \"%"TS"\"",
                      resource_wimfiles[i]);
-               ret = wimlib_open_wim(resource_wimfiles[i], open_flags,
-                                     &resource_wims[i], progress_func);
+               ret = wimlib_open_wim_with_progress(resource_wimfiles[i],
+                                                   open_flags,
+                                                   &resource_wims[i],
+                                                   wim->progfunc,
+                                                   wim->progctx);
                if (ret)
                        goto out_free_resource_wims;
        }
@@ -197,8 +197,7 @@ out_free_array:
 
 static int
 reference_resource_glob(WIMStruct *wim, const tchar *refglob,
-                       int ref_flags, int open_flags,
-                       wimlib_progress_func_t progress_func)
+                       int ref_flags, int open_flags)
 {
        glob_t globbuf;
        int ret;
@@ -215,8 +214,7 @@ reference_resource_glob(WIMStruct *wim, const tchar *refglob,
                                                                &refglob,
                                                                1,
                                                                ref_flags,
-                                                               open_flags,
-                                                               progress_func);
+                                                               open_flags);
                        }
                } else {
                        ERROR_WITH_ERRNO("Failed to process glob \"%"TS"\"", refglob);
@@ -231,8 +229,7 @@ reference_resource_glob(WIMStruct *wim, const tchar *refglob,
                                       (const tchar * const *)globbuf.gl_pathv,
                                       globbuf.gl_pathc,
                                       ref_flags,
-                                      open_flags,
-                                      progress_func);
+                                      open_flags);
        globfree(&globbuf);
        return ret;
 }
@@ -243,8 +240,7 @@ wimlib_reference_resource_files(WIMStruct *wim,
                                const tchar * const * resource_wimfiles_or_globs,
                                unsigned count,
                                int ref_flags,
-                               int open_flags,
-                               wimlib_progress_func_t progress_func)
+                               int open_flags)
 {
        unsigned i;
        int ret;
@@ -257,15 +253,13 @@ wimlib_reference_resource_files(WIMStruct *wim,
                        ret = reference_resource_glob(wim,
                                                      resource_wimfiles_or_globs[i],
                                                      ref_flags,
-                                                     open_flags,
-                                                     progress_func);
+                                                     open_flags);
                        if (ret)
                                return ret;
                }
                return 0;
        } else {
                return reference_resource_paths(wim, resource_wimfiles_or_globs,
-                                               count, ref_flags,
-                                               open_flags, progress_func);
+                                               count, ref_flags, open_flags);
        }
 }