int add_flags,
wimlib_progress_func_t progress_func);
+/**
+ * @ingroup G_modifying_wims
+ *
+ * Add the file or directory tree at @p fs_source_path on the filesystem to the
+ * location @p wim_target_path within the specified @p image of the @p wim.
+ *
+ * This just builds an appropriate ::wimlib_add_command and passes it to
+ * wimlib_update_image().
+ */
+extern int
+wimlib_add_tree(WIMStruct *wim, int image,
+ const wimlib_tchar *fs_source_path,
+ const wimlib_tchar *wim_target_path, int add_flags);
+
/**
* @ingroup G_creating_and_opening_wims
*
extern int
wimlib_delete_image(WIMStruct *wim, int image);
+/**
+ * @ingroup G_modifying_wims
+ *
+ * Delete the @p path from the specified @p image of the @p wim.
+ *
+ * This just builds an appropriate ::wimlib_delete_command and passes it to
+ * wimlib_update_image().
+ */
+extern int
+wimlib_delete_path(WIMStruct *wim, int image,
+ const wimlib_tchar *path, int delete_flags);
+
/**
* @ingroup G_modifying_wims
*
WIMStruct *template_wim, int template_image,
int flags, wimlib_progress_func_t progress_func);
+/**
+ * @ingroup G_modifying_wims
+ *
+ * Rename the @p source_path to the @p dest_path in the specified @p image of
+ * the @p wim.
+ *
+ * This just builds an appropriate ::wimlib_rename_command and passes it to
+ * wimlib_update_image().
+ */
+extern int
+wimlib_rename_path(WIMStruct *wim, int image,
+ const wimlib_tchar *source_path, const wimlib_tchar *dest_path);
+
/**
* @ingroup G_wim_information
*
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);
+}