-#include "wimlib_internal.h"
-#include "lookup_table.h"
-#include "xml.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "wimlib.h"
+#include "wimlib/capture.h"
+#include "wimlib/error.h"
+#include "wimlib/lookup_table.h"
+#include "wimlib/metadata.h"
+#include "wimlib/xml.h"
if (wimlib_image_name_in_use(wim, name)) {
ERROR("There is already an image named \"%"TS"\" in the WIM!",
if (wimlib_image_name_in_use(wim, name)) {
ERROR("There is already an image named \"%"TS"\" in the WIM!",
static struct wimlib_update_command *
capture_sources_to_add_cmds(const struct wimlib_capture_source *sources,
size_t num_sources,
static struct wimlib_update_command *
capture_sources_to_add_cmds(const struct wimlib_capture_source *sources,
size_t num_sources,
sources[i].fs_source_path,
sources[i].wim_target_path);
add_cmds[i].op = WIMLIB_UPDATE_OP_ADD;
sources[i].fs_source_path,
sources[i].wim_target_path);
add_cmds[i].op = WIMLIB_UPDATE_OP_ADD;
add_cmds[i].add.config = (struct wimlib_capture_config*)config;
add_cmds[i].add.fs_source_path = sources[i].fs_source_path;
add_cmds[i].add.wim_target_path = sources[i].wim_target_path;
add_cmds[i].add.config = (struct wimlib_capture_config*)config;
add_cmds[i].add.fs_source_path = sources[i].fs_source_path;
add_cmds[i].add.wim_target_path = sources[i].wim_target_path;
WIMLIBAPI int
wimlib_add_image_multisource(WIMStruct *wim,
const struct wimlib_capture_source *sources,
size_t num_sources,
const tchar *name,
const struct wimlib_capture_config *config,
WIMLIBAPI int
wimlib_add_image_multisource(WIMStruct *wim,
const struct wimlib_capture_source *sources,
size_t num_sources,
const tchar *name,
const struct wimlib_capture_config *config,
- DEBUG("Adding image \"%"TS"\" from %zu sources (add_image_flags=%#x)",
- name, num_sources, add_image_flags);
+ DEBUG("Adding image \"%"TS"\" from %zu sources (add_flags=%#x)",
+ name, num_sources, add_flags);
/* Add the new image (initially empty) */
ret = wimlib_add_empty_image(wim, name, NULL);
/* Add the new image (initially empty) */
ret = wimlib_add_empty_image(wim, name, NULL);
/* Translate the "capture sources" into generic update commands. */
add_cmds = capture_sources_to_add_cmds(sources, num_sources,
/* Translate the "capture sources" into generic update commands. */
add_cmds = capture_sources_to_add_cmds(sources, num_sources,
- ret = wimlib_update_image(wim, wim->hdr.image_count, add_cmds,
+ ret = wimlib_update_image(wim, wim->hdr.image_count, add_cmds,
num_sources, 0, progress_func);
FREE(add_cmds);
if (ret)
goto out_delete_image;
/* Success; set boot index if requested. */
num_sources, 0, progress_func);
FREE(add_cmds);
if (ret)
goto out_delete_image;
/* Success; set boot index if requested. */
WIMLIBAPI int
wimlib_add_image(WIMStruct *wim,
const tchar *source,
const tchar *name,
const struct wimlib_capture_config *config,
WIMLIBAPI int
wimlib_add_image(WIMStruct *wim,
const tchar *source,
const tchar *name,
const struct wimlib_capture_config *config,
wimlib_progress_func_t progress_func)
{
/* Delegate the work to the more general wimlib_add_image_multisource().
wimlib_progress_func_t progress_func)
{
/* Delegate the work to the more general wimlib_add_image_multisource().
.reserved = 0,
};
return wimlib_add_image_multisource(wim, &capture_src, 1, name,
.reserved = 0,
};
return wimlib_add_image_multisource(wim, &capture_src, 1, name,