New -toc report lines "Drive id :" and "Media id :".

This commit is contained in:
Thomas Schmitt 2015-10-18 13:00:02 +00:00
parent 54ebdfe339
commit fdf10cadc1
3 changed files with 36 additions and 4 deletions

View File

@ -991,9 +991,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
int disk_category, part_version, num_layers, num_blocks;
char *book_name;
int num_data_from_format= 0;
/*
int num_payload= 0, num_wasted= 0, num_nondata= 0;
*/
char *sno = NULL;
int sno_len, i;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print Table Of Content",
@ -1021,6 +1020,17 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_toc_line(xorriso, flag & 8);
if(flag & 32)
{ret= 1; goto ex;}
if(!(flag & 1)) {
burn_drive_get_serial_no(drive, &sno, &sno_len);
if(sno_len > 0) {
sprintf(respt, "Drive id : '%s'\n", sno);
Xorriso_toc_line(xorriso, flag & 8);
}
if(sno != NULL)
free(sno);
sno= NULL;
}
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
s= isoburn_disc_get_status(drive);
@ -1089,6 +1099,24 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if((s == BURN_DISC_FULL || s == BURN_DISC_APPENDABLE ||
s == BURN_DISC_BLANK) && !(flag & 1)) {
burn_drive_get_media_sno(drive, &sno, &sno_len);
if(sno_len > 0) {
sprintf(respt, "Media id : ");
respt+= strlen(respt);
for(i= 0; i < sno_len && i < 1024; i++) {
sprintf(respt, "%2.2X", (unsigned int) ((unsigned char *) sno)[i]);
respt+= 2;
}
if(i < sno_len)
strcat(respt, "...");
strcat(respt, "\n");
Xorriso_toc_line(xorriso, flag & 8);
}
if(sno != NULL)
free(sno);
sno= NULL;
respt= xorriso->result_line;
ret= burn_get_read_capacity(drive, &num_data, 0);
if(ret != 1 || s == BURN_DISC_BLANK)
num_data= 0;

View File

@ -2026,6 +2026,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
1, 0},
{"Drive current:", 3, "Drive current:", "", 2, { 0, 1, -1, -1, -1, -1},
2, 0},
{"Drive id :", 3, "Drive id :", "", 1, { 0, -1, -1, -1, -1, -1},
2, 0},
{"Drive type :", 3, "Drive type :", "", 3, { 1, 3, 5, -1, -1, -1},
2, 0},
{"Eff. Time :", 3, "Eff. Time : ", "", 1, { 0, -1, -1, -1, -1, -1},
@ -2060,6 +2062,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
2, 0},
{"Media current:", 3, "Media current: ", "", 1, { 0, -1, -1, -1, -1, -1},
2, 1},
{"Media id :", 3, "Media id :", "", 1, { 0, -1, -1, -1, -1, -1},
2, 0},
{"Media nwa :", 3, "Media nwa :", "", 1, { 0, -1, -1, -1, -1, -1},
1, 0},
{"Media product:", 3, "Media product:", "", 2, { 0, 2, -1, -1, -1, -1},

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.10.16.155137"
#define Xorriso_timestamP "2015.10.18.130151"