]> wimlib.net Git - wimlib/commitdiff
split.c: Allow customizing part names
authorEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 20:40:10 +0000 (15:40 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 20:40:10 +0000 (15:40 -0500)
include/wimlib.h
src/split.c

index 728d132af45f57bc0b3e80645c85905ae370cc8d..110b0fa5ad8d8c3fb7b4849cf2aecb2c03ae8080 100644 (file)
@@ -931,8 +931,12 @@ union wimlib_progress_info {
 
                /** Name of the split WIM part that is about to be started
                 * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been
 
                /** Name of the split WIM part that is about to be started
                 * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been
-                * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */
-               const wimlib_tchar *part_name;
+                * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART).
+                * As of wimlib v1.6.3, the library user may change this when
+                * receiving ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART in order to
+                * cause the next split WIM part to be written to a different
+                * location.  */
+               wimlib_tchar *part_name;
        } split;
 
        /** Valid on messages ::WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM  */
        } split;
 
        /** Valid on messages ::WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM  */
index a611816da99a79c929213b3011693e229d5c9a8b..7f04648516865027d0ce41171259cf3ce249fea7 100644 (file)
@@ -97,7 +97,6 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
        for (part_number = 1; part_number <= swm_info->num_parts; part_number++)
                progress.split.total_bytes += swm_info->parts[part_number - 1].size;
        progress.split.total_parts = swm_info->num_parts;
        for (part_number = 1; part_number <= swm_info->num_parts; part_number++)
                progress.split.total_bytes += swm_info->parts[part_number - 1].size;
        progress.split.total_parts = swm_info->num_parts;
-       progress.split.part_name = swm_name_buf;
 
        randomize_byte_array(guid, WIMLIB_GUID_LEN);
 
 
        randomize_byte_array(guid, WIMLIB_GUID_LEN);
 
@@ -111,6 +110,7 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
                }
 
                progress.split.cur_part_number = part_number;
                }
 
                progress.split.cur_part_number = part_number;
+               progress.split.part_name = swm_name_buf;
 
                ret = call_progress(orig_wim->progfunc,
                                    WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART,
 
                ret = call_progress(orig_wim->progfunc,
                                    WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART,
@@ -127,7 +127,7 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name,
                progfunc = orig_wim->progfunc;
                orig_wim->progfunc = NULL;
                ret = write_wim_part(orig_wim,
                progfunc = orig_wim->progfunc;
                orig_wim->progfunc = NULL;
                ret = write_wim_part(orig_wim,
-                                    swm_name_buf,
+                                    progress.split.part_name,
                                     WIMLIB_ALL_IMAGES,
                                     part_write_flags,
                                     1,
                                     WIMLIB_ALL_IMAGES,
                                     part_write_flags,
                                     1,