]> wimlib.net Git - wimlib/blobdiff - src/update_image.c
Remove duplicate words & fix grammatical errors
[wimlib] / src / update_image.c
index df0ab99049721bc62d4fa327da33e18d00c1d7b7..14f316366c74951939660366cf3c07d715fcf282 100644 (file)
@@ -1106,7 +1106,7 @@ execute_update_commands(WIMStruct *wim,
                if (ret)
                        goto out;
 
-               ret = init_sd_set(sd_set, wim_security_data(wim));
+               ret = init_sd_set(sd_set, wim_get_current_security_data(wim));
                if (ret)
                        goto out_destroy_inode_table;
 
@@ -1266,7 +1266,7 @@ check_add_command(struct wimlib_update_command *cmd,
 
        if (!is_entire_image) {
                if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
-                       ERROR("Cannot add directly from a NTFS volume "
+                       ERROR("Cannot add directly from an NTFS volume "
                              "when not capturing a full image!");
                        return WIMLIB_ERR_INVALID_PARAM;
                }
@@ -1471,3 +1471,52 @@ out_free_cmds_copy:
 out:
        return ret;
 }
+
+static int
+update1(WIMStruct *wim, int image, const struct wimlib_update_command *cmd)
+{
+       return wimlib_update_image(wim, image, cmd, 1, 0, NULL);
+}
+
+WIMLIBAPI int
+wimlib_delete_path(WIMStruct *wim, int image,
+                  const tchar *path, int delete_flags)
+{
+       struct wimlib_update_command cmd;
+
+       cmd.op = WIMLIB_UPDATE_OP_DELETE;
+       cmd.delete_.wim_path = (tchar *)path;
+       cmd.delete_.delete_flags = delete_flags;
+
+       return update1(wim, image, &cmd);
+}
+
+WIMLIBAPI int
+wimlib_rename_path(WIMStruct *wim, int image,
+                  const tchar *source_path, const tchar *dest_path)
+{
+       struct wimlib_update_command cmd;
+
+       cmd.op = WIMLIB_UPDATE_OP_RENAME;
+       cmd.rename.wim_source_path = (tchar *)source_path;
+       cmd.rename.wim_target_path = (tchar *)dest_path;
+       cmd.rename.rename_flags = 0;
+
+       return update1(wim, image, &cmd);
+}
+
+WIMLIBAPI int
+wimlib_add_tree(WIMStruct *wim, int image,
+               const tchar *fs_source_path, const tchar *wim_target_path,
+               int add_flags)
+{
+       struct wimlib_update_command cmd;
+
+       cmd.op = WIMLIB_UPDATE_OP_ADD;
+       cmd.add.fs_source_path = (tchar *)fs_source_path;
+       cmd.add.wim_target_path = (tchar *)wim_target_path;
+       cmd.add.add_flags = add_flags;
+       cmd.add.config_file = NULL;
+
+       return update1(wim, image, &cmd);
+}