New command -toc_info_type

This commit is contained in:
2024-06-28 16:42:28 +02:00
parent 2306175432
commit 7f1abc4174
14 changed files with 304 additions and 89 deletions

View File

@ -1085,6 +1085,14 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
off_t lba= 0, nwa= -1, track_size, session_size, first_track_start= 0;
off_t num_session_data, num_session_other, num_data= 0, other_data= 0;
off_t emul_lba, end_lba, image_blocks, overburn_blocks= 0;
int info_type;
static char *info_type_name[]= {"", "Volume Id", "", "Creation Time",
"Modification Time"};
static int max_info_type= 4;
info_type= xorriso->toc_info_type;
if(info_type < 1 || info_type > max_info_type)
info_type= 1;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print Table Of Content",
@ -1343,7 +1351,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
"Idx", "sbsector", "Size");
else
sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n",
"Idx", "sbsector", "Size", "Volume Id");
"Idx", "sbsector", "Size", info_type_name[info_type]);
if(!(flag&1))
Xorriso_toc_line(xorriso, flag & 8);
@ -1372,8 +1380,12 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if(flag & 4) {
ret= 0;
typetext= "Session ";
} else
ret= isoburn_read_iso_head_v2(drive, 0, &image_blocks, volume_id, 1);
} else {
ret= isoburn_read_iso_head_v2(drive, 0, &image_blocks, volume_id,
info_type);
if(ret > 0 && (info_type == 3 || info_type == 4))
Untimezone_ecma119_17byte(volume_id, (xorriso->toc_time_form & 1) | 2);
}
if(ret>0) {
sprintf(respt, "ISO session : %3d , %9d , %9.fs , %s\n",
1, 0, (double) image_blocks, volume_id);
@ -1444,9 +1456,13 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
} else {
ret= isoburn_toc_track_get_emul_v2(tracks[track_no], &emul_lba,
&image_blocks, volume_id, 0);
if(ret <= 0)
if(ret <= 0 || info_type != 1) {
ret= isoburn_read_iso_head_v2(drive, lba, &image_blocks, volume_id,
1);
info_type);
if(ret > 0 && (info_type == 3 || info_type == 4))
Untimezone_ecma119_17byte(volume_id,
(xorriso->toc_time_form & 1) | 2);
}
if(image_blocks > track_size) {
sprintf(xorriso->info_text,
"Session %d bears ISO image size %.fs larger than track size %.fs",