Bug fix: Corrected handling of -as cdrecord -mode2, -xa, -xa2, -xa2, -xamix, xorrisofs -help, xorrecord -help

This commit is contained in:
Thomas Schmitt 2009-09-20 09:27:29 +00:00
parent 9d1ce48f3b
commit 68f0cfd3a5
3 changed files with 119 additions and 75 deletions

View File

@ -10291,57 +10291,8 @@ int Xorriso_reaquire_outdev(struct XorrisO *xorriso, int flag)
}
/* micro version of cdrskin */
int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
int flag)
int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
{
int ret, i, k, mem_do_close, aq_ret, eject_ret, msc1, msc2, hflag;
int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0;
int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0;
int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0;
double write_start_address= -1.0, tsize= -1.0;
char track_source[SfileadrL], sfe[5*SfileadrL], dev_adr[SfileadrL], *cpt;
char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80];
char speed[80];
/* cdrecord 2.01 options which are not scheduled for implementation, yet */
static char ignored_partial_options[][41]= {
"timeout=", "debug=", "kdebug=", "kd=", "driver=", "ts=",
"pregap=", "defpregap=", "mcn=", "isrc=", "index=", "textfile=",
"pktsize=", "cuefile=",
"gracetime=", "minbuf=",
"assert_write_lba=", "fifo_start_at=", "dev_translation=",
"drive_scsi_dev_family=", "fallback_program=", "modesty_on_drive=",
"tao_to_sao_tsize=",
"direct_write_amount=", "msifile=",
""
};
static char ignored_full_options[][41]= {
"-d", "-Verbose", "-V", "-silent", "-s", "-setdropts", "-prcap",
"-reset", "-abort", "-overburn", "-ignsize", "-useinfo",
"-fix", "-nofix",
"-raw", "-raw96p", "-raw16",
"-clone", "-text", "-mode2", "-xa", "-xa1", "-xa2", "-xamix",
"-cdi", "-preemp", "-nopreemp", "-copy", "-nocopy",
"-scms", "-shorttrack", "-noshorttrack", "-packet", "-noclose",
"-media-info", "-minfo",
"-load", "-lock", "-raw96r", "-sao", "-dao", "-swab",
"-tao", "-force", "-format",
"--adjust_speed_to_drive", "--allow_emulated_drives", "--allow_setuid",
"--allow_untested_media", "--any_track", "--demand_a_drive",
"--fifo_disable", "--fifo_start_empty", "--fill_up_media",
"--list_ignored_options", "--no_rc", "--no_convert_fs_adr",
"--prodvd_cli_compatible", "--single_track",
"--tell_media_space",
""
};
static char helptext[][80]= {
"Usage: xorriso -as cdrecord [options|source_addresses]",
"Note: This is not cdrecord. See xorriso -help, xorriso -version, man xorriso",
@ -10378,7 +10329,65 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
"A much more elaborate cdrecord emulator is cdrskin from the same project.",
"@End_of_helptexT@"
};
/* "\t-scanbus\tscan the SCSI bus and exit emulation", */
int i;
for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) {
sprintf(xorriso->info_text, "%s\n", helptext[i]);
Xorriso_info(xorriso,0);
}
return(1);
}
/* micro version of cdrskin */
int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
int flag)
{
int ret, i, k, mem_do_close, aq_ret, eject_ret, msc1, msc2, hflag;
int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0;
int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0;
int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0, do_xa1= 0;
double write_start_address= -1.0, tsize= -1.0;
char track_source[SfileadrL], sfe[5*SfileadrL], dev_adr[SfileadrL], *cpt;
char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80];
char speed[80];
/* cdrecord 2.01 options which are not scheduled for implementation, yet */
static char ignored_partial_options[][41]= {
"timeout=", "debug=", "kdebug=", "kd=", "driver=", "ts=",
"pregap=", "defpregap=", "mcn=", "isrc=", "index=", "textfile=",
"pktsize=", "cuefile=",
"gracetime=", "minbuf=",
"assert_write_lba=", "fifo_start_at=", "dev_translation=",
"drive_scsi_dev_family=", "fallback_program=", "modesty_on_drive=",
"tao_to_sao_tsize=",
"direct_write_amount=", "msifile=",
""
};
static char ignored_full_options[][41]= {
"-d", "-Verbose", "-V", "-silent", "-s", "-setdropts", "-prcap",
"-reset", "-abort", "-overburn", "-ignsize", "-useinfo",
"-fix", "-nofix",
"-raw", "-raw96p", "-raw16",
"-clone", "-text",
"-cdi", "-preemp", "-nopreemp", "-copy", "-nocopy",
"-scms", "-shorttrack", "-noshorttrack", "-packet", "-noclose",
"-media-info", "-minfo",
"-load", "-lock", "-raw96r", "-sao", "-dao", "-swab",
"-tao", "-force", "-format",
"--adjust_speed_to_drive", "--allow_emulated_drives", "--allow_setuid",
"--allow_untested_media", "--any_track", "--demand_a_drive",
"--fifo_disable", "--fifo_start_empty", "--fill_up_media",
"--list_ignored_options", "--no_rc", "--no_convert_fs_adr",
"--prodvd_cli_compatible", "--single_track",
"--tell_media_space",
""
};
static char blank_help[][80]= {
"Blanking options:",
@ -10501,6 +10510,9 @@ no_volunteer:;
do_isosize= 1;
} else if(strcmp(argv[i], "-inq")==0) {
do_checkdrive= 2;
} else if(strcmp(argv[i], "-mode2")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -mode2 to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-msinfo")==0) {
do_msinfo= 1;
} else if(strcmp(argv[i], "-multi")==0) {
@ -10533,7 +10545,7 @@ no_volunteer:;
cpt= strchr(argv[i], '=')+1;
Xorriso_option_stream_recording(xorriso, cpt, 0);
} else if(strcmp(argv[i], "-toc")==0) {
} else if(strcmp(argv[i], "-toc")==0 || strcmp(argv[i], "--long_toc")==0) {
do_toc= 1;
} else if(strncmp(argv[i], "-tsize=", 7)==0 ||
strncmp(argv[i], "tsize=", 6)==0) {
@ -10556,6 +10568,22 @@ no_volunteer:;
do_waiti= 1;
} else if(strncmp(argv[i], "write_start_address=", 20)==0) {
write_start_address= Scanf_io_size(argv[i]+20,0);
} else if(strcmp(argv[i], "-xa")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -xa to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-xa1")==0) {
if(do_xa1 == 0)
do_xa1= 1;
} else if(strcmp(argv[i], "--xa1-ignore")==0) {
do_xa1= -1;
} else if(strcmp(argv[i], "-xa2")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -xa2 to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-xamix")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Option -xamix not implemented and data not yet convertible to other modes",
0, "FATAL", 0);
ret= 0; goto ex;
} else if(argv[i][0]=='-' && argv[i][1]!=0) {
sprintf(xorriso->info_text, "-as %s: Unknown option %s",
whom, Text_shellsafe(argv[i], sfe, 0));
@ -10608,10 +10636,7 @@ no_volunteer:;
}
if(do_help) {
for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) {
sprintf(xorriso->info_text, "%s\n", helptext[i]);
Xorriso_info(xorriso,0);
}
Xorriso_cdrskin_help(xorriso, 0);
ret= 1; goto ex;
}
if(do_scanbus) {
@ -10691,7 +10716,7 @@ no_volunteer:;
xorriso->do_close= !do_multi;
ret= Xorriso_burn_track(xorriso, (off_t) write_start_address,
track_source, (off_t) tsize,
(!!do_grow)|((!!do_isosize)<<1));
(!!do_grow) | ((!!do_isosize) << 1) | ((do_xa1 == 1) << 2));
aq_ret= Xorriso_reaquire_outdev(xorriso, 2*(ret>0));
if(ret<=0 && ret<aq_ret)
goto ex;
@ -10758,16 +10783,8 @@ no_volunteer:;
}
/* micro emulation of mkisofs */
int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int argc, char **argv, int flag)
int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
{
int ret, i, was_path= 0, was_other_option= 0, mem_graft_points, mem;
int do_print_size= 0, fd, idx, iso_level= 0, no_emul_boot= 0;
int option_b= 0, was_failure= 0, fret;
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
static char helptext[][80]= {
"Usage: xorriso -as mkisofs [options] file...",
"Note: This is not mkisofs. See xorriso -help, xorriso -version, man xorriso",
@ -10814,6 +10831,30 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
" -version Print the current version",
"@End_of_helptexT@"
};
char ra_text[80];
int i;
strcpy(ra_text, xorriso->report_about_text);
Xorriso_option_report_about(xorriso, "NOTE", 0);
for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) {
sprintf(xorriso->info_text, "%s\n", helptext[i]);
Xorriso_info(xorriso, 1);
}
Xorriso_option_report_about(xorriso, ra_text, 0);
return(1);
}
/* micro emulation of mkisofs */
int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int argc, char **argv, int flag)
{
int ret, i, was_path= 0, was_other_option= 0, mem_graft_points, mem;
int do_print_size= 0, fd, idx, iso_level= 0, no_emul_boot= 0;
int option_b= 0, was_failure= 0, fret;
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
strcpy(ra_text, xorriso->report_about_text);
@ -10859,12 +10900,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
strncpy(msc, argv[i], sizeof(msc)-1);
msc[sizeof(msc)-1]= 0;
} else if(strcmp(argv[i], "-help")==0) {
Xorriso_option_report_about(xorriso, "NOTE", 0);
for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) {
sprintf(xorriso->info_text, "%s\n", helptext[i]);
Xorriso_info(xorriso, 1);
}
Xorriso_option_report_about(xorriso, ra_text, 0);
Xorriso_genisofs_help(xorriso, 0);
} else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i], "-verbose")==0) {
strcpy(ra_text, "UPDATE");
} else if(strcmp(argv[i], "-quiet")==0) {
@ -20014,7 +20050,13 @@ int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv,
xorriso->did_something_useful= 1;
{ret= 0; goto ex;}
} else if(strcmp(cmd,"help")==0) {
Xorriso_option_help(xorriso,0);
if(xorriso->argument_emulation == 1) {
Xorriso_genisofs_help(xorriso, 0);
} else if(xorriso->argument_emulation == 2) {
Xorriso_cdrskin_help(xorriso, 0);
} else {
Xorriso_option_help(xorriso,0);
}
xorriso->did_something_useful= 1;
{ret= 0; goto ex;}
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.09.19.161026"
#define Xorriso_timestamP "2009.09.20.092811"

View File

@ -1353,7 +1353,7 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
do_eject= !!(flag&4);
if((flag & 4) && !xorriso->outdev_is_exclusive) {
sprintf(xorriso->info_text,
"Will not eject media in non-exclusively aquired output drive.");
"Will not eject media in non-exclusively aquired drive.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
do_eject= 0;
}
@ -8862,6 +8862,7 @@ int Xorriso_update_iso_lba0(struct XorrisO *xorriso, int iso_lba, int isosize,
@param tsize is valid if >0
@param flag bit0= grow_overwriteable_iso
bit1= do_isosize
bit2= do_xa1 conversion
*/
int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
char *track_source, off_t tsize, int flag)
@ -8943,6 +8944,7 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
ret= 0; goto ex;
}
burn_track_set_cdxa_conv(track, !!(flag & 4));
burn_session_add_track(session, track, BURN_POS_END);
burn_source_free(data_src);