]> wimlib.net Git - wimlib/commitdiff
add_image => add
authorEric Biggers <ebiggers3@gmail.com>
Sun, 12 May 2013 01:42:55 +0000 (20:42 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 12 May 2013 01:42:55 +0000 (20:42 -0500)
src/add_image.c
src/dentry.h
src/ntfs-apply.c
src/ntfs-capture.c
src/unix_capture.c
src/update_image.c
src/wimlib.h
src/wimlib_internal.h
src/win32.c

index dbc97e668195ff1a4ccbc6c907b8f056ace803de..263c2e757330ecb5931a19a98763a1d21cf5d79b 100644 (file)
@@ -121,7 +121,7 @@ out:
 static struct wimlib_update_command *
 capture_sources_to_add_cmds(const struct wimlib_capture_source *sources,
                            size_t num_sources,
-                           int add_image_flags,
+                           int add_flags,
                            const struct wimlib_capture_config *config)
 {
        struct wimlib_update_command *add_cmds;
@@ -137,7 +137,7 @@ capture_sources_to_add_cmds(const struct wimlib_capture_source *sources,
                              sources[i].fs_source_path,
                              sources[i].wim_target_path);
                        add_cmds[i].op = WIMLIB_UPDATE_OP_ADD;
-                       add_cmds[i].add.add_flags = add_image_flags;
+                       add_cmds[i].add.add_flags = add_flags;
                        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;
@@ -154,14 +154,14 @@ wimlib_add_image_multisource(WIMStruct *wim,
                             size_t num_sources,
                             const tchar *name,
                             const struct wimlib_capture_config *config,
-                            int add_image_flags,
+                            int add_flags,
                             wimlib_progress_func_t progress_func)
 {
        int ret;
        struct wimlib_update_command *add_cmds;
 
-       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);
@@ -170,7 +170,7 @@ wimlib_add_image_multisource(WIMStruct *wim,
 
        /* Translate the "capture sources" into generic update commands. */
        add_cmds = capture_sources_to_add_cmds(sources, num_sources,
-                                              add_image_flags, config);
+                                              add_flags, config);
        if (!add_cmds) {
                ret = WIMLIB_ERR_NOMEM;
                goto out_delete_image;
@@ -184,7 +184,7 @@ wimlib_add_image_multisource(WIMStruct *wim,
                goto out_delete_image;
 
        /* Success; set boot index if requested. */
-       if (add_image_flags & WIMLIB_ADD_IMAGE_FLAG_BOOT)
+       if (add_flags & WIMLIB_ADD_FLAG_BOOT)
                wim->hdr.boot_idx = wim->hdr.image_count;
        ret = 0;
        goto out;
@@ -204,7 +204,7 @@ wimlib_add_image(WIMStruct *wim,
                 const tchar *source,
                 const tchar *name,
                 const struct wimlib_capture_config *config,
-                int add_image_flags,
+                int add_flags,
                 wimlib_progress_func_t progress_func)
 {
        /* Delegate the work to the more general wimlib_add_image_multisource().
@@ -215,6 +215,6 @@ wimlib_add_image(WIMStruct *wim,
                .reserved = 0,
        };
        return wimlib_add_image_multisource(wim, &capture_src, 1, name,
-                                           config, add_image_flags,
+                                           config, add_flags,
                                            progress_func);
 }
index d3060be99048e22db5957b98d69a99e47318907c..58adb5e681a9022b599be911d90219097d96f4a9 100644 (file)
@@ -461,7 +461,7 @@ inode_remove_ads(struct wim_inode *inode, u16 idx,
 #define WIMLIB_UNIX_DATA_TAG_UTF16LE_NBYTES (sizeof(WIMLIB_UNIX_DATA_TAG_UTF16LE) - 1)
 
 /* Format for special alternate data stream entries to store UNIX data for files
- * and directories (see: WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) */
+ * and directories (see: WIMLIB_ADD_FLAG_UNIX_DATA) */
 struct wimlib_unix_data {
        u16 version; /* Must be 0 */
        u16 uid;
index 35760400bc9530463e0227589071a6667eeb6a66..3881f0f4e6562bfb37a1313e733423b60de7b7ad 100644 (file)
@@ -117,7 +117,7 @@ write_ntfs_data_streams(ntfs_inode *ni, struct wim_dentry *dentry,
        for (;;) {
                if (stream_name_nbytes) {
                        /* Skip special UNIX data entries (see documentation for
-                        * WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) */
+                        * WIMLIB_ADD_FLAG_UNIX_DATA) */
                        if (stream_name_nbytes == WIMLIB_UNIX_DATA_TAG_UTF16LE_NBYTES
                            && !memcmp(stream_name,
                                       WIMLIB_UNIX_DATA_TAG_UTF16LE,
index 9797e3382daaff9c32295bababb05a8eed3e85d8..b0258a891367a32966c0a777f54bb5c0d171ce0a 100644 (file)
@@ -546,7 +546,7 @@ build_dentry_tree_ntfs_recursive(struct wim_dentry **root_ret,
        if (exclude_path(path, path_len, params->config, false)) {
                /* Exclude a file or directory tree based on the capture
                 * configuration file */
-               if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE)
+               if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
                    && params->progress_func)
                {
                        union wimlib_progress_info info;
@@ -572,7 +572,7 @@ build_dentry_tree_ntfs_recursive(struct wim_dentry **root_ret,
                return WIMLIB_ERR_NTFS_3G;
        }
 
-       if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_VERBOSE)
+       if ((params->add_flags & WIMLIB_ADD_FLAG_VERBOSE)
            && params->progress_func)
        {
                union wimlib_progress_info info;
@@ -647,11 +647,11 @@ build_dentry_tree_ntfs_recursive(struct wim_dentry **root_ret,
 
        /* Reparse-point fixups are a no-op because in NTFS-3g capture mode we
         * only allow capturing an entire volume. */
-       if (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX &&
+       if (params->add_flags & WIMLIB_ADD_FLAG_RPFIX &&
            inode_is_symlink(inode))
                inode->i_not_rpfixed = 0;
 
-       if (!(params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_NO_ACLS)) {
+       if (!(params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS)) {
                /* Get security descriptor */
                char _sd[1];
                char *sd = _sd;
index f3e9f0e564866f3b7b760a39f5f64627ec5d34dc..4f526f7dda1029815a5cfd553458b83b38dc7696 100644 (file)
@@ -147,7 +147,7 @@ unix_capture_symlink(struct wim_dentry **root_p,
                dest[deref_name_len] = '\0';
                DEBUG("Read symlink `%s'", dest);
 
-               if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX) &&
+               if ((params->add_flags & WIMLIB_ADD_FLAG_RPFIX) &&
                     dest[0] == '/')
                {
                        dest = capture_fixup_absolute_symlink(dest,
@@ -196,7 +196,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        struct wim_inode *inode;
 
        if (exclude_path(path, path_len, params->config, true)) {
-               if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE)
+               if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
                    && params->progress_func)
                {
                        union wimlib_progress_info info;
@@ -207,7 +207,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
                goto out;
        }
 
-       if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_VERBOSE)
+       if ((params->add_flags & WIMLIB_ADD_FLAG_VERBOSE)
            && params->progress_func)
        {
                union wimlib_progress_info info;
@@ -218,8 +218,8 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
 
        struct stat stbuf;
        int (*stat_fn)(const char *restrict, struct stat *restrict);
-       if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE) ||
-           (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_ROOT))
+       if ((params->add_flags & WIMLIB_ADD_FLAG_DEREFERENCE) ||
+           (params->add_flags & WIMLIB_ADD_FLAG_ROOT))
                stat_fn = stat;
        else
                stat_fn = lstat;
@@ -258,7 +258,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        inode->i_last_access_time = unix_timestamp_to_wim(stbuf.st_atime);
 #endif
        inode->i_resolved = 1;
-       if (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) {
+       if (params->add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) {
                ret = inode_set_unix_data(inode, stbuf.st_uid,
                                          stbuf.st_gid,
                                          stbuf.st_mode,
@@ -267,7 +267,7 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret,
                if (ret)
                        goto out;
        }
-       params->add_image_flags &= ~WIMLIB_ADD_IMAGE_FLAG_ROOT;
+       params->add_flags &= ~WIMLIB_ADD_FLAG_ROOT;
        if (S_ISREG(stbuf.st_mode))
                ret = unix_capture_regular_file(path, stbuf.st_size,
                                                inode, params->lookup_table);
@@ -320,7 +320,7 @@ unix_build_dentry_tree(struct wim_dentry **root_ret,
                        return WIMLIB_ERR_STAT;
                }
 
-               if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_ROOT) &&
+               if ((params->add_flags & WIMLIB_ADD_FLAG_ROOT) &&
                    !S_ISDIR(root_stbuf.st_mode))
                {
                        ERROR("Root of capture \"%s\" is not a directory",
index 96583927b517c6d3a1814a206915b6366b665ec1..6ad963f0620972d5f6b4f6c5126ee572928a7909 100644 (file)
@@ -207,7 +207,7 @@ execute_add_command(WIMStruct *wim,
 
        imd = wim->image_metadata[wim->current_image - 1];
 
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_NTFS) {
+       if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
        #ifdef WITH_NTFS_3G
                capture_tree = build_dentry_tree_ntfs;
                extra_arg = &ntfs_vol;
@@ -243,7 +243,7 @@ execute_add_command(WIMStruct *wim,
        params.inode_table = &inode_table;
        params.sd_set = &sd_set;
        params.config = config;
-       params.add_image_flags = add_flags;
+       params.add_flags = add_flags;
        params.progress_func = progress_func;
        params.extra_arg = extra_arg;
 
@@ -257,7 +257,7 @@ execute_add_command(WIMStruct *wim,
        config->_prefix_num_tchars = tstrlen(fs_source_path);
 
        if (wim_target_path[0] == T('\0'))
-               add_flags |= WIMLIB_ADD_IMAGE_FLAG_ROOT;
+               add_flags |= WIMLIB_ADD_FLAG_ROOT;
        ret = (*capture_tree)(&branch, fs_source_path, &params);
        if (ret) {
                ERROR("Failed to build dentry tree for \"%"TS"\"",
@@ -287,7 +287,7 @@ execute_add_command(WIMStruct *wim,
        inode_table_prepare_inode_list(&inode_table, &imd->inode_list);
        ret = 0;
        rollback_sd = false;
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX)
+       if (add_flags & WIMLIB_ADD_FLAG_RPFIX)
                wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;
        goto out_destroy_sd_set;
 out_ntfs_umount:
@@ -502,30 +502,30 @@ check_add_command(struct wimlib_update_command *cmd,
 
 #ifdef __WIN32__
        /* Check for flags not supported on Windows */
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_NTFS) {
+       if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
                ERROR("wimlib was compiled without support for NTFS-3g, so");
                ERROR("we cannot capture a WIM image directly from a NTFS volume");
                return WIMLIB_ERR_UNSUPPORTED;
        }
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) {
+       if (add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) {
                ERROR("Capturing UNIX-specific data is not supported on Windows");
                return WIMLIB_ERR_INVALID_PARAM;
        }
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE) {
+       if (add_flags & WIMLIB_ADD_FLAG_DEREFERENCE) {
                ERROR("Dereferencing symbolic links is not supported on Windows");
                return WIMLIB_ERR_INVALID_PARAM;
        }
 #endif
 
        /* VERBOSE implies EXCLUDE_VERBOSE */
-       if (add_flags & WIMLIB_ADD_IMAGE_FLAG_VERBOSE)
-               add_flags |= WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE;
+       if (add_flags & WIMLIB_ADD_FLAG_VERBOSE)
+               add_flags |= WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE;
 
        /* Check for contradictory reparse point fixup flags */
-       if ((add_flags & (WIMLIB_ADD_IMAGE_FLAG_RPFIX |
-                         WIMLIB_ADD_IMAGE_FLAG_NORPFIX)) ==
-               (WIMLIB_ADD_IMAGE_FLAG_RPFIX |
-                WIMLIB_ADD_IMAGE_FLAG_NORPFIX))
+       if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |
+                         WIMLIB_ADD_FLAG_NORPFIX)) ==
+               (WIMLIB_ADD_FLAG_RPFIX |
+                WIMLIB_ADD_FLAG_NORPFIX))
        {
                ERROR("Cannot specify RPFIX and NORPFIX flags "
                      "at the same time!");
@@ -533,30 +533,31 @@ check_add_command(struct wimlib_update_command *cmd,
        }
 
        /* Set default behavior on reparse point fixups if requested */
-       if ((add_flags & (WIMLIB_ADD_IMAGE_FLAG_RPFIX |
-                         WIMLIB_ADD_IMAGE_FLAG_NORPFIX)) == 0)
+       if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |
+                         WIMLIB_ADD_FLAG_NORPFIX)) == 0)
        {
                /* Do reparse-point fixups by default if we are capturing an
                 * entire image and either the header flag is set from previous
                 * images, or if this is the first image being added. */
                if (is_entire_image &&
                    ((hdr->flags & WIM_HDR_FLAG_RP_FIX) || hdr->image_count == 1))
-                       add_flags |= WIMLIB_ADD_IMAGE_FLAG_RPFIX;
+                       add_flags |= WIMLIB_ADD_FLAG_RPFIX;
        }
 
        if (!is_entire_image) {
-               if (add_flags & WIMLIB_ADD_IMAGE_FLAG_NTFS) {
+               if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
                        ERROR("Cannot add directly from a NTFS volume "
                              "when not capturing a full image!");
                        return WIMLIB_ERR_INVALID_PARAM;
                }
 
-               if (add_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX) {
+               if (add_flags & WIMLIB_ADD_FLAG_RPFIX) {
                        ERROR("Cannot do reparse point fixups when "
                              "not capturing a full image!");
                        return WIMLIB_ERR_INVALID_PARAM;
                }
        }
+       /* We may have modified the add flags. */
        cmd->add.add_flags = add_flags;
        return 0;
 }
index a433a9bcf631f2aadbb5a05859dfe6f2eea73786..48922f55e32ef9eb4f700b42e8844c1d9dba05dc 100644 (file)
  * wimlib_add_image().  This can be done with a ::WIMStruct gotten from
  * wimlib_open_wim() or from wimlib_create_new_wim().  wimlib_add_image() can
  * also capture a WIM image directly from a NTFS volume if you provide the
- * ::WIMLIB_ADD_IMAGE_FLAG_NTFS flag, provided that wimlib was not compiled with
+ * ::WIMLIB_ADD_FLAG_NTFS flag, provided that wimlib was not compiled with
  * the <code>--without-ntfs-3g</code> flag.
  *
  * To extract an image from a WIM file, call wimlib_extract_image().  You may
@@ -345,7 +345,7 @@ enum wimlib_progress_msg {
 
        /** A directory or file is being scanned.  @a info will point to
         * ::wimlib_progress_info.scan, and its @a cur_path member will be
-        * valid.  This message is only sent if ::WIMLIB_ADD_IMAGE_FLAG_VERBOSE
+        * valid.  This message is only sent if ::WIMLIB_ADD_FLAG_VERBOSE
         * is passed to wimlib_add_image(). */
        WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
 
@@ -665,49 +665,49 @@ struct wimlib_capture_config {
 
 
 /*****************************
- * WIMLIB_ADD_IMAGE_FLAG_*   *
+ * WIMLIB_ADD_FLAG_*   *
  *****************************/
 
 /** Directly capture a NTFS volume rather than a generic directory.  This flag
- * cannot be combined with ::WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE or
- * ::WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA.   */
-#define WIMLIB_ADD_IMAGE_FLAG_NTFS                     0x00000001
+ * cannot be combined with ::WIMLIB_ADD_FLAG_DEREFERENCE or
+ * ::WIMLIB_ADD_FLAG_UNIX_DATA.   */
+#define WIMLIB_ADD_FLAG_NTFS                   0x00000001
 
 /** Follow symlinks; archive and dump the files they point to.  Cannot be used
- * with ::WIMLIB_ADD_IMAGE_FLAG_NTFS. */
-#define WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE              0x00000002
+ * with ::WIMLIB_ADD_FLAG_NTFS. */
+#define WIMLIB_ADD_FLAG_DEREFERENCE            0x00000002
 
 /** Call the progress function with the message
  * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when each directory or file is starting to
  * be scanned. */
-#define WIMLIB_ADD_IMAGE_FLAG_VERBOSE                  0x00000004
+#define WIMLIB_ADD_FLAG_VERBOSE                        0x00000004
 
 /** Mark the image being added as the bootable image of the WIM. */
-#define WIMLIB_ADD_IMAGE_FLAG_BOOT                     0x00000008
+#define WIMLIB_ADD_FLAG_BOOT                   0x00000008
 
 /** Store the UNIX owner, group, and mode.  This is done by adding a special
  * alternate data stream to each regular file, symbolic link, and directory to
  * contain this information.  Please note that this flag is for convenience
  * only; Microsoft's @a imagex.exe will not understand this special information.
- * This flag cannot be combined with ::WIMLIB_ADD_IMAGE_FLAG_NTFS.  */
-#define WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA                        0x00000010
+ * This flag cannot be combined with ::WIMLIB_ADD_FLAG_NTFS.  */
+#define WIMLIB_ADD_FLAG_UNIX_DATA                      0x00000010
 
 /** Do not capture security descriptors.  Only has an effect in NTFS capture
  * mode, or in Win32 native builds. */
-#define WIMLIB_ADD_IMAGE_FLAG_NO_ACLS                  0x00000020
+#define WIMLIB_ADD_FLAG_NO_ACLS                        0x00000020
 
 /** Fail immediately if the full security descriptor of any file or directory
  * cannot be accessed.  Only has an effect in Win32 native builds.  The default
  * behavior without this flag is to first try omitting the SACL from the
  * security descriptor, then to try omitting the security descriptor entirely.
  * */
-#define WIMLIB_ADD_IMAGE_FLAG_STRICT_ACLS              0x00000040
+#define WIMLIB_ADD_FLAG_STRICT_ACLS            0x00000040
 
 /** Call the progress function with the message
  * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when a directory or file is excluded from
  * capture.  This is a subset of the messages provided by
- * ::WIMLIB_ADD_IMAGE_FLAG_VERBOSE. */
-#define WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE          0x00000080
+ * ::WIMLIB_ADD_FLAG_VERBOSE. */
+#define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE                0x00000080
 
 /** Reparse-point fixups:  Modify absolute symbolic links (or junction points,
  * in the case of Windows) that point inside the directory being captured to
@@ -719,11 +719,22 @@ struct wimlib_capture_config {
  * the WIM header or if this is the first image being added.
  * WIM_HDR_FLAG_RP_FIX is set if the first image in a WIM is captured with
  * reparse point fixups enabled and currently cannot be unset. */
-#define WIMLIB_ADD_IMAGE_FLAG_RPFIX                    0x00000100
+#define WIMLIB_ADD_FLAG_RPFIX                  0x00000100
 
 /** Don't do reparse point fixups.  The default behavior is described in the
- * documentation for ::WIMLIB_ADD_IMAGE_FLAG_RPFIX. */
-#define WIMLIB_ADD_IMAGE_FLAG_NORPFIX                  0x00000200
+ * documentation for ::WIMLIB_ADD_FLAG_RPFIX. */
+#define WIMLIB_ADD_FLAG_NORPFIX                        0x00000200
+
+#define WIMLIB_ADD_IMAGE_FLAG_NTFS             WIMLIB_ADD_FLAG_NTFS
+#define WIMLIB_ADD_IMAGE_FLAG_DEREFERENCE      WIMLIB_ADD_FLAG_DEREFERENCE
+#define WIMLIB_ADD_IMAGE_FLAG_VERBOSE          WIMLIB_ADD_FLAG_VERBOSE
+#define WIMLIB_ADD_IMAGE_FLAG_BOOT             WIMLIB_ADD_FLAG_BOOT
+#define WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA                WIMLIB_ADD_FLAG_UNIX_DATA
+#define WIMLIB_ADD_IMAGE_FLAG_NO_ACLS          WIMLIB_ADD_FLAG_NO_ACLS 
+#define WIMLIB_ADD_IMAGE_FLAG_STRICT_ACLS      WIMLIB_ADD_FLAG_STRICT_ACLS
+#define WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE  WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE 
+#define WIMLIB_ADD_IMAGE_FLAG_RPFIX            WIMLIB_ADD_FLAG_RPFIX
+#define WIMLIB_ADD_IMAGE_FLAG_NORPFIX          WIMLIB_ADD_FLAG_NORPFIX
 
 /** Do not issue an error if the path to delete does not exist. */
 #define WIMLIB_DELETE_FLAG_FORCE                       0x00000001
@@ -764,7 +775,7 @@ struct wimlib_capture_config {
 /** Read the WIM file sequentially while extracting the image. */
 #define WIMLIB_EXTRACT_FLAG_SEQUENTIAL                 0x00000010
 
-/** Extract special UNIX data captured with ::WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA.
+/** Extract special UNIX data captured with ::WIMLIB_ADD_FLAG_UNIX_DATA.
  * Cannot be used with ::WIMLIB_EXTRACT_FLAG_NTFS. */
 #define WIMLIB_EXTRACT_FLAG_UNIX_DATA                  0x00000020
 
@@ -779,7 +790,7 @@ struct wimlib_capture_config {
  * not have permission to set the desired one. */
 #define WIMLIB_EXTRACT_FLAG_STRICT_ACLS                        0x00000080
 
-/* Extract equivalent to ::WIMLIB_ADD_IMAGE_FLAG_RPFIX; force reparse-point
+/* Extract equivalent to ::WIMLIB_ADD_FLAG_RPFIX; force reparse-point
  * fixups on, so absolute symbolic links or junction points will be fixed to be
  * absolute relative to the actual extraction root.  Done by default if
  * WIM_HDR_FLAG_RP_FIX is set in the WIM header.  This flag may only be
@@ -815,7 +826,7 @@ struct wimlib_capture_config {
 #define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS     0x00000010
 
 /** Use UNIX file owners, groups, and modes if available in the WIM (see
- * ::WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA). */
+ * ::WIMLIB_ADD_FLAG_UNIX_DATA). */
 #define WIMLIB_MOUNT_FLAG_UNIX_DATA                    0x00000020
 
 /** Allow other users to see the mounted filesystem.  (this passes the @c
@@ -1047,7 +1058,7 @@ wimlib_add_empty_image(WIMStruct *wim,
  *
  * See the manual page for the @b wimlib-imagex program for more information
  * about the "normal" capture mode versus the NTFS capture mode (entered by
- * providing the flag ::WIMLIB_ADD_IMAGE_FLAG_NTFS).
+ * providing the flag ::WIMLIB_ADD_FLAG_NTFS).
  *
  * Note that @b no changes are committed to the underlying WIM file (if
  * any) until wimlib_write() or wimlib_overwrite() is called.
@@ -1064,8 +1075,8 @@ wimlib_add_empty_image(WIMStruct *wim,
  *     Capture configuration that specifies files, directories, or path globs
  *     to exclude from being captured.  If @c NULL, a dummy configuration where
  *     no paths are treated specially is used.
- * @param add_image_flags
- *     Bitwise OR of flags prefixed with WIMLIB_ADD_IMAGE_FLAG.
+ * @param add_flags
+ *     Bitwise OR of flags prefixed with WIMLIB_ADD_FLAG.
  * @param progress_func
  *     If non-NULL, a function that will be called periodically with the
  *     progress of the current operation.
@@ -1084,34 +1095,34 @@ wimlib_add_empty_image(WIMStruct *wim,
  * @retval ::WIMLIB_ERR_NOMEM
  *     Failed to allocate needed memory.
  * @retval ::WIMLIB_ERR_NOTDIR
- *     @a source is not a directory (only if ::WIMLIB_ADD_IMAGE_FLAG_NTFS was
- *     not specified in @a add_image_flags).
+ *     @a source is not a directory (only if ::WIMLIB_ADD_FLAG_NTFS was
+ *     not specified in @a add_flags).
  * @retval ::WIMLIB_ERR_NTFS_3G
  *     An error was returned from a libntfs-3g function when the NTFS volume
  *     was being opened, scanned, or closed (only if
- *     ::WIMLIB_ADD_IMAGE_FLAG_NTFS was specified in @a add_image_flags).
+ *     ::WIMLIB_ADD_FLAG_NTFS was specified in @a add_flags).
  * @retval ::WIMLIB_ERR_OPEN
  *     Failed to open a file or directory in the directory tree rooted at @a
- *     source (only if ::WIMLIB_ADD_IMAGE_FLAG_NTFS was not specified in @a
- *     add_image_flags).
+ *     source (only if ::WIMLIB_ADD_FLAG_NTFS was not specified in @a
+ *     add_flags).
  * @retval ::WIMLIB_ERR_READ
  *     Failed to read a file in the directory tree rooted at @a source (only if
- *     ::WIMLIB_ADD_IMAGE_FLAG_NTFS was not specified in @a add_image_flags).
+ *     ::WIMLIB_ADD_FLAG_NTFS was not specified in @a add_flags).
  * @retval ::WIMLIB_ERR_SPECIAL_FILE
  *     The directory tree rooted at @a source contains a special file that is
  *     not a directory, regular file, or symbolic link.  This currently can
- *     only be returned if ::WIMLIB_ADD_IMAGE_FLAG_NTFS was not specified in @a
- *     add_image_flags, but it may be returned for unsupported NTFS files in
+ *     only be returned if ::WIMLIB_ADD_FLAG_NTFS was not specified in @a
+ *     add_flags, but it may be returned for unsupported NTFS files in
  *     the future.
  * @retval ::WIMLIB_ERR_STAT
  *     Failed obtain the metadata for a file or directory in the directory tree
- *     rooted at @a source (only if ::WIMLIB_ADD_IMAGE_FLAG_NTFS was not
- *     specified in @a add_image_flags).
+ *     rooted at @a source (only if ::WIMLIB_ADD_FLAG_NTFS was not
+ *     specified in @a add_flags).
  * @retval ::WIMLIB_ERR_SPLIT_UNSUPPORTED
  *     @a wim is part of a split WIM.  Adding an image to a split WIM is
  *     unsupported.
  * @retval ::WIMLIB_ERR_UNSUPPORTED
- *     ::WIMLIB_ADD_IMAGE_FLAG_NTFS was specified in @a add_image_flags, but
+ *     ::WIMLIB_ADD_FLAG_NTFS was specified in @a add_flags, but
  *     wimlib was configured with the @c --without-ntfs-3g flag.
  */
 extern int
@@ -1119,7 +1130,7 @@ wimlib_add_image(WIMStruct *wim,
                 const wimlib_tchar *source,
                 const wimlib_tchar *name,
                 const struct wimlib_capture_config *config,
-                int add_image_flags,
+                int add_flags,
                 wimlib_progress_func_t progress_func);
 
 /** This function is equivalent to wimlib_add_image() except it allows for
@@ -1134,7 +1145,7 @@ wimlib_add_image(WIMStruct *wim,
  * when trying to overlay a non-directory on a directory or when otherwise
  * trying to overlay multiple conflicting files to the same location in the WIM
  * image.  It will also return ::WIMLIB_ERR_INVALID_PARAM if
- * ::WIMLIB_ADD_IMAGE_FLAG_NTFS was specified in @a add_image_flags but there
+ * ::WIMLIB_ADD_FLAG_NTFS was specified in @a add_flags but there
  * was not exactly one capture source with the target being the root directory.
  * (In this respect, there is no advantage to using
  * wimlib_add_image_multisource() instead of wimlib_add_image() when requesting
@@ -1145,7 +1156,7 @@ wimlib_add_image_multisource(WIMStruct *w,
                             size_t num_sources,
                             const wimlib_tchar *name,
                             const struct wimlib_capture_config *config,
-                            int add_image_flags,
+                            int add_flags,
                             wimlib_progress_func_t progress_func);
 
 /**
index 55fcd8f308ad17d3dbb8fc884ce66b10337f0587..bde8115204d2734a097fe06df368e7998cb14d33 100644 (file)
@@ -198,7 +198,7 @@ struct wim_header {
 #define WIM_HDR_FLAG_WRITE_IN_PROGRESS  0x00000040
 
 /* Reparse point fixup flag.  See docs for --rpfix and --norpfix in imagex, or
- * WIMLIB_ADD_IMAGE_FLAG_{RPFIX,NORPFIX} in wimlib.h.  Note that
+ * WIMLIB_ADD_FLAG_{RPFIX,NORPFIX} in wimlib.h.  Note that
  * WIM_HDR_FLAG_RP_FIX is a header flag and just sets the default behavior for
  * the WIM; it can still be overridder on a per-image basis.  But there is no
  * flag to set the default behavior for a specific image. */
@@ -437,8 +437,8 @@ struct add_image_params {
         * files should be excluded from capture or not. */
        const struct wimlib_capture_config *config;
 
-       /* Flags that affect the capture operation (WIMLIB_ADD_IMAGE_FLAG_*) */
-       int add_image_flags;
+       /* Flags that affect the capture operation (WIMLIB_ADD_FLAG_*) */
+       int add_flags;
 
        /* If non-NULL, the user-supplied progress function. */
        wimlib_progress_func_t progress_func;
@@ -811,7 +811,7 @@ close_wim(WIMStruct *w);
 #define WIMLIB_WRITE_MASK_PUBLIC               0x1fffffff
 
 /* We are capturing a tree to be placed in the root of the WIM image */
-#define WIMLIB_ADD_IMAGE_FLAG_ROOT     0x80000000
+#define WIMLIB_ADD_FLAG_ROOT   0x80000000
 
 extern int
 begin_write(WIMStruct *w, const tchar *path, int write_flags);
index f49cbeb1f8c1f8fc98c9c697da5c80e2d4b14803..f9f4276510c6b066bb0329592504dd359aa7eb5c 100644 (file)
@@ -702,7 +702,7 @@ win32_get_security_descriptor(struct wim_dentry *dentry,
                              struct sd_set *sd_set,
                              const wchar_t *path,
                              struct win32_capture_state *state,
-                             int add_image_flags)
+                             int add_flags)
 {
        SECURITY_INFORMATION requestedInformation;
        DWORD lenNeeded = 0;
@@ -737,7 +737,7 @@ again:
                }
        }
 
-       if (add_image_flags & WIMLIB_ADD_IMAGE_FLAG_STRICT_ACLS)
+       if (add_flags & WIMLIB_ADD_FLAG_STRICT_ACLS)
                goto fail;
 
        switch (err) {
@@ -927,7 +927,7 @@ enum rp_status {
  * fixup where we change it to be absolute relative to the root of the directory
  * tree being captured.
  *
- * Note that this is only executed when WIMLIB_ADD_IMAGE_FLAG_RPFIX has been
+ * Note that this is only executed when WIMLIB_ADD_FLAG_RPFIX has been
  * set.
  *
  * @capture_root_ino and @capture_root_dev indicate the inode number and device
@@ -1085,7 +1085,7 @@ win32_get_reparse_data(HANDLE hFile, const wchar_t *path,
 
        rpbuflen = bytesReturned;
        reparse_tag = le32_to_cpu(*(u32*)rpbuf);
-       if (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX &&
+       if (params->add_flags & WIMLIB_ADD_FLAG_RPFIX &&
            (reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK ||
             reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT))
        {
@@ -1405,12 +1405,12 @@ win32_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        u16 not_rpfixed;
 
        if (exclude_path(path, path_num_chars, params->config, true)) {
-               if (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_ROOT) {
+               if (params->add_flags & WIMLIB_ADD_FLAG_ROOT) {
                        ERROR("Cannot exclude the root directory from capture");
                        ret = WIMLIB_ERR_INVALID_CAPTURE_CONFIG;
                        goto out;
                }
-               if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE)
+               if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
                    && params->progress_func)
                {
                        union wimlib_progress_info info;
@@ -1422,7 +1422,7 @@ win32_build_dentry_tree_recursive(struct wim_dentry **root_ret,
                goto out;
        }
 
-       if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_VERBOSE)
+       if ((params->add_flags & WIMLIB_ADD_FLAG_VERBOSE)
            && params->progress_func)
        {
                union wimlib_progress_info info;
@@ -1501,14 +1501,14 @@ win32_build_dentry_tree_recursive(struct wim_dentry **root_ret,
        inode->i_last_access_time = FILETIME_to_u64(&file_info.ftLastAccessTime);
        inode->i_resolved = 1;
 
-       params->add_image_flags &= ~WIMLIB_ADD_IMAGE_FLAG_ROOT;
+       params->add_flags &= ~WIMLIB_ADD_FLAG_ROOT;
 
-       if (!(params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_NO_ACLS)
+       if (!(params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS)
            && (vol_flags & FILE_PERSISTENT_ACLS))
        {
                ret = win32_get_security_descriptor(root, params->sd_set,
                                                    path, state,
-                                                   params->add_image_flags);
+                                                   params->add_flags);
                if (ret)
                        goto out_close_handle;
        }
@@ -1558,7 +1558,7 @@ out:
 
 static void
 win32_do_capture_warnings(const struct win32_capture_state *state,
-                         int add_image_flags)
+                         int add_flags)
 {
        if (state->num_get_sacl_priv_notheld == 0 &&
            state->num_get_sd_access_denied == 0)
@@ -1581,7 +1581,7 @@ win32_do_capture_warnings(const struct win32_capture_state *state,
 "          desired metadata has been captured exactly.  However, if you\n"
 "          do not care about capturing security descriptors correctly, then\n"
 "          nothing more needs to be done%ls\n",
-       (add_image_flags & WIMLIB_ADD_IMAGE_FLAG_NO_ACLS) ? L"." :
+       (add_flags & WIMLIB_ADD_FLAG_NO_ACLS) ? L"." :
          L", although you might consider\n"
 "          passing the --no-acls flag to `wimlib-imagex capture' or\n"
 "          `wimlib-imagex append' to explicitly capture no security\n"
@@ -1637,7 +1637,7 @@ win32_build_dentry_tree(struct wim_dentry **root_ret,
                                                &state, vol_flags);
        FREE(path);
        if (ret == 0)
-               win32_do_capture_warnings(&state, params->add_image_flags);
+               win32_do_capture_warnings(&state, params->add_flags);
        return ret;
 }
 
@@ -2617,7 +2617,7 @@ win32_extract_streams(const struct wim_dentry *dentry,
                        continue;
 
                /* Skip special UNIX data entries (see documentation for
-                * WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) */
+                * WIMLIB_ADD_FLAG_UNIX_DATA) */
                if (ads_entry->stream_name_nbytes == WIMLIB_UNIX_DATA_TAG_UTF16LE_NBYTES
                    && !memcmp(ads_entry->stream_name,
                               WIMLIB_UNIX_DATA_TAG_UTF16LE,