Now recognizing long -as cdrecord options with double dash

This commit is contained in:
Thomas Schmitt 2012-04-10 07:15:15 +00:00
parent 194ef1fbe9
commit d1512ed525
2 changed files with 78 additions and 69 deletions

View File

@ -108,7 +108,7 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
double write_start_address= -1.0, tsize= -1.0;
char *track_source= NULL, *dev_adr= NULL, *cpt;
char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80];
char speed[80];
char speed[80], *argpt;
/* cdrecord 2.01 options which are not scheduled for implementation, yet */
static char ignored_partial_options[][41]= {
@ -185,35 +185,41 @@ static char blank_help[][80]= {
Text_shellsafe(argv[i], xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
argpt= argv[i];
if (strncmp(argpt, "--", 2) == 0 && strlen(argpt) > 3)
argpt++;
for(k=0;ignored_partial_options[k][0]!=0;k++) {
if(argv[i][0]=='-')
if(strncmp(argv[i]+1,ignored_partial_options[k],
strlen(ignored_partial_options[k]))==0)
if(argpt[0]=='-')
if(strncmp(argpt+1,ignored_partial_options[k],
strlen(ignored_partial_options[k]))==0) {
argpt++;
goto no_volunteer;
if(strncmp(argv[i],ignored_partial_options[k],
}
if(strncmp(argpt,ignored_partial_options[k],
strlen(ignored_partial_options[k]))==0)
goto no_volunteer;
}
for(k=0;ignored_full_options[k][0]!=0;k++)
if(strcmp(argv[i],ignored_full_options[k])==0)
if(strcmp(argpt,ignored_full_options[k])==0)
goto no_volunteer;
if(0) {
no_volunteer:;
sprintf(xorriso->info_text, "-as %s: Ignored option ", whom);
Text_shellsafe(argv[i], xorriso->info_text, 1);
Text_shellsafe(argpt, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
continue;
}
if(strcmp(argv[i], "-atip")==0) {
if(strcmp(argpt, "-atip")==0) {
do_atip= 1;
} else if(strcmp(argv[i], "-audio")==0) {
} else if(strcmp(argpt, "-audio")==0) {
sprintf(xorriso->info_text, "-as %s: Option -audio not supported.", whom);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
} else if(strncmp(argv[i], "-blank=", 7)==0 ||
strncmp(argv[i], "blank=", 6)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-blank=", 7)==0 ||
strncmp(argpt, "blank=", 6)==0) {
cpt= strchr(argpt, '=')+1;
if(strcmp(cpt,"all")==0 || strcmp(cpt,"disc")==0
|| strcmp(cpt,"disk")==0) {
strcpy(blank_mode, "all");
@ -232,134 +238,137 @@ no_volunteer:;
strcpy(blank_mode, "as_needed");
} else {
sprintf(xorriso->info_text, "-as %s: blank=", whom);
Text_shellsafe(argv[i], xorriso->info_text, 1);
Text_shellsafe(cpt, xorriso->info_text, 1);
strcat(xorriso->info_text, " not supported. See blank=help .");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
} else if(strcmp(argv[i], "-checkdrive")==0) {
} else if(strcmp(argpt, "-checkdrive")==0) {
do_checkdrive= 1;
} else if(strcmp(argv[i], "-data")==0) {
} else if(strcmp(argpt, "-data")==0) {
/* ok */;
} else if(strncmp(argv[i], "-dev=", 5)==0 ||
strncmp(argv[i], "dev=", 4)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-dev=", 5)==0 ||
strncmp(argpt, "dev=", 4)==0) {
cpt= strchr(argpt, '=')+1;
strcpy(dev_adr, cpt);
} else if(strcmp(argv[i], "--devices")==0) {
} else if(strcmp(argv[i], "--devices")==0) { /* intentional: argv[i] */
do_scanbus= 2;
} else if(strncmp(argv[i],"driveropts=", 11)==0 ||
strncmp(argv[i],"-driveropts=", 12)==0) {
if(strcmp(argv[i]+11, "help")==0) {
} else if(strncmp(argpt,"driveropts=", 11)==0 ||
strncmp(argpt,"-driveropts=", 12)==0) {
if(strcmp(argpt+11, "help")==0) {
fprintf(stderr,"Driver options:\n");
fprintf(stderr,
"burnfree\tPrepare writer to use BURN-Free technology\n");
}
} else if(strcmp(argv[i], "-dummy")==0) {
} else if(strcmp(argpt, "-dummy")==0) {
xorriso->do_dummy= 1;
} else if(strcmp(argv[i], "-eject")==0) {
} else if(strcmp(argpt, "-eject")==0) {
do_eject= 1;
} else if(strncmp(argv[i], "-fs=", 4)==0 || strncmp(argv[i], "fs=", 3)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-fs=", 4)==0 || strncmp(argpt, "fs=", 3)==0) {
cpt= strchr(argpt, '=')+1;
ret= Xorriso_option_fs(xorriso, cpt, 0);
if(ret<=0)
goto ex;
} else if(strcmp(argv[i], "--grow_overwriteable_iso")==0) {
/* intentional: argv[i] */
do_grow= 1;
} else if(strcmp(argv[i], "-help")==0) {
} else if(strcmp(argpt, "-help")==0) {
do_help= 1;
} else if(strcmp(argv[i], "-isosize")==0) {
} else if(strcmp(argpt, "-isosize")==0) {
do_isosize= 1;
} else if(strcmp(argv[i], "-inq")==0) {
} else if(strcmp(argpt, "-inq")==0) {
do_checkdrive= 2;
} else if(strcmp(argv[i], "-mode2")==0) {
} else if(strcmp(argpt, "-mode2")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -mode2 to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-msinfo")==0) {
} else if(strcmp(argpt, "-msinfo")==0) {
do_msinfo= 1;
} else if(strcmp(argv[i], "-multi")==0) {
} else if(strcmp(argpt, "-multi")==0) {
do_multi= 1;
} else if(strcmp(argv[i], "-nopad")==0) {
} else if(strcmp(argpt, "-nopad")==0) {
xorriso->padding= 0;
} else if(strcmp(argv[i], "--no_rc")==0) {
} else if(strcmp(argv[i], "--no_rc")==0) { /* intentional: argv[i] */
/* already performed in Xorriso_prescan_args */;
} else if(strcmp(argv[i], "-pad")==0) {
} else if(strcmp(argpt, "-pad")==0) {
xorriso->padding= 15*2048;
} else if(strncmp(argv[i], "-padsize=", 9)==0 ||
strncmp(argv[i], "padsize=", 8)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-padsize=", 9)==0 ||
strncmp(argpt, "padsize=", 8)==0) {
cpt= strchr(argpt, '=')+1;
ret= Xorriso_option_padding(xorriso, cpt, 0);
if(ret<=0)
goto ex;
} else if(strcmp(argv[i], "-scanbus")==0) {
} else if(strcmp(argpt, "-scanbus")==0) {
sprintf(xorriso->info_text, "-as %s: Option -scanbus not supported.",
whom);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
/* do_scanbus= 1; */
} else if(strncmp(argv[i], "-speed=", 7)==0 ||
strncmp(argv[i], "speed=", 6)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-speed=", 7)==0 ||
strncmp(argpt, "speed=", 6)==0) {
cpt= strchr(argpt, '=')+1;
strncpy(speed, cpt, 79);
speed[79]= 0;
} else if(strncmp(argv[i], "-stream_recording=", 18)==0 ||
strncmp(argv[i], "stream_recording=", 17)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-stream_recording=", 18)==0 ||
strncmp(argpt, "stream_recording=", 17)==0) {
cpt= strchr(argpt, '=')+1;
Xorriso_option_stream_recording(xorriso, cpt, 0);
} else if(strncmp(argv[i], "-dvd_obs=", 9)==0 ||
strncmp(argv[i], "dvd_obs=", 8)==0) {
cpt= strchr(argv[i], '=') + 1;
} else if(strncmp(argpt, "-dvd_obs=", 9)==0 ||
strncmp(argpt, "dvd_obs=", 8)==0) {
cpt= strchr(argpt, '=') + 1;
Xorriso_option_dvd_obs(xorriso, cpt, 0);
} else if(strncmp(argv[i], "-stdio_sync=", 12)==0 ||
strncmp(argv[i], "stdio_sync=", 11)==0) {
cpt= strchr(argv[i], '=') + 1;
} else if(strncmp(argpt, "-stdio_sync=", 12)==0 ||
strncmp(argpt, "stdio_sync=", 11)==0) {
cpt= strchr(argpt, '=') + 1;
Xorriso_option_stdio_sync(xorriso, cpt, 0);
} else if(strcmp(argv[i], "-toc")==0 || strcmp(argv[i], "--long_toc")==0) {
} else if(strcmp(argpt, "-toc")==0 || strcmp(argv[i], "--long_toc")==0) {
/* intentional: argpt , argv[i] */
do_toc= 1;
} else if(strncmp(argv[i], "-tsize=", 7)==0 ||
strncmp(argv[i], "tsize=", 6)==0) {
cpt= strchr(argv[i], '=')+1;
} else if(strncmp(argpt, "-tsize=", 7)==0 ||
strncmp(argpt, "tsize=", 6)==0) {
cpt= strchr(argpt, '=')+1;
tsize= Scanf_io_size(cpt, 1);
if(tsize > 1024.0*1024.0*1024.0*1024.0*1024.0) {
sprintf(xorriso->info_text, "-as %s: much too large: %s",whom, argv[i]);
sprintf(xorriso->info_text, "-as %s: much too large: %s",whom, argpt);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
} else if(strcmp(argv[i], "-V")==0 || strcmp(argv[i],"-Verbose")==0) {
} else if(strcmp(argv[i], "-V")==0 || strcmp(argpt,"-Verbose")==0) {
Xorriso_option_scsi_log(xorriso, "on", 0);
} else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i],"-verbose")==0) {
} else if(strcmp(argv[i], "-v")==0 || strcmp(argpt,"-verbose")==0) {
do_verbous++;
} else if(strcmp(argv[i], "-vv")==0) {
} else if(strcmp(argv[i], "-vv")==0) { /* intentional: argv[i] */
do_verbous+= 2;
} else if(strcmp(argv[i], "-vvv")==0) {
} else if(strcmp(argv[i], "-vvv")==0) { /* intentional: argv[i] */
do_verbous+= 3;
} else if(strcmp(argv[i], "-version")==0) {
} else if(strcmp(argpt, "-version")==0) {
do_version= 1;
} else if(strcmp(argv[i], "-waiti")==0) {
} else if(strcmp(argpt, "-waiti")==0) {
do_waiti= 1;
} else if(strncmp(argv[i], "write_start_address=", 20)==0) {
/* intentional: argv[i] */
write_start_address= Scanf_io_size(argv[i]+20,0);
} else if(strcmp(argv[i], "-xa")==0) {
} else if(strcmp(argpt, "-xa")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -xa to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-xa1")==0) {
} else if(strcmp(argpt, "-xa1")==0) {
if(do_xa1 == 0)
do_xa1= 1;
} else if(strcmp(argv[i], "--xa1-ignore")==0) {
} else if(strcmp(argv[i], "--xa1-ignore")==0) { /* intentional: argv[i] */
do_xa1= -1;
} else if(strcmp(argv[i], "-xa2")==0) {
} else if(strcmp(argpt, "-xa2")==0) {
Xorriso_msgs_submit(xorriso, 0,
"Defaulting option -xa2 to option -data", 0, "NOTE", 0);
} else if(strcmp(argv[i], "-xamix")==0) {
} else if(strcmp(argpt, "-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) {
} else if(argpt[0]=='-' && argpt[1]!=0) {
sprintf(xorriso->info_text, "-as %s: Unknown option ", whom);
Text_shellsafe(argv[i], xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.04.06.173904"
#define Xorriso_timestamP "2012.04.10.071539"