From: Eric Biggers Date: Thu, 22 May 2014 20:40:10 +0000 (-0500) Subject: split.c: Allow customizing part names X-Git-Tag: v1.7.0~116 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=941a5957f1fb7dd990d04dee47c3a86bc1572d8f split.c: Allow customizing part names --- diff --git a/include/wimlib.h b/include/wimlib.h index 728d132a..110b0fa5 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -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 - * 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 */ diff --git a/src/split.c b/src/split.c index a611816d..7f046485 100644 --- a/src/split.c +++ b/src/split.c @@ -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; - progress.split.part_name = swm_name_buf; 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.part_name = swm_name_buf; 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, - swm_name_buf, + progress.split.part_name, WIMLIB_ALL_IMAGES, part_write_flags, 1,