cdrecord emulation by start names xorrecord, cdrecord, wodim, cdrskin

This commit is contained in:
Thomas Schmitt 2008-07-10 16:27:35 +00:00
parent 279690522d
commit 1d5a1370be
4 changed files with 44 additions and 16 deletions

View File

@ -1792,7 +1792,7 @@ Personalites "\fBxorrisofs\fR", "\fBgenisoimage\fR", and "\fBgenisofs\fR"
are aliases for "mkisofs".
.br
If xorriso is started with one of the leafnames "xorrisofs", "genisofs",
"mkisofs", or "genisoimage", then it automatically prepends -as "mkisofs"
"mkisofs", or "genisoimage", then it automatically prepends -as "genisofs"
to the command line arguments. I.e. all arguments will be interpreted mkisofs
style until "--" is encountered. From then on, options are interpreted
as xorriso options.
@ -1803,16 +1803,16 @@ Personality "\fBcdrecord\fR" accepts the options listed with:
-as cdrecord -help --
.br
Among them: -v, dev=, speed=, blank=, fs=, -eject, -atip, padsize=,
-multi, -msinfo,
track source file path or "-" for standard input as track source.
.br
It ignores most other options of cdrecord and cdrskin but refuses on
-audio, -scanbus, -multi, -msinfo, --grow_overwriteable_iso,
and on blanking modes unknown to xorriso.
.br
The scope is for now only a single first data track to be written to blank or
overwriteable media. If possible the media will get closed afterwards.
The scope is only a single data track per session to be written
to blank, overwriteable, or appendable media. The media gets closed if
closing is applicable and not option -multi is present.
.br
An eventually aquired input drive is given up.
This is only allowed if no image changes are pending.
@ -1825,7 +1825,14 @@ the "cdrecord" option list.
.br
A much more elaborate libburn based cdrecord emulator is the program cdrskin.
.br
Personalites "\fBwodim\fR" and "\fBcdrskin\fR" are aliases for "cdrecord".
Personalites "\fBxorrecord\fR", "\fBwodim\fR", and "\fBcdrskin\fR" are aliases
for "cdrecord".
.br
If xorriso is started with one of the leafnames "xorrecord", "cdrskin",
"cdrecord", or "wodim", then it automatically prepends -as "cdrskin"
to the command line arguments. I.e. all arguments will be interpreted cdrecord
style until "--" is encountered and an eventual commit happens.
From then on, options are interpreted as xorriso options.
.TP
.B Scripting, dialog and program control features:
.TP

View File

@ -2937,6 +2937,9 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
strcmp(leafname, "mkisofs")==0 || strcmp(leafname, "genisoimage")==0) {
m->argument_emulation= 1;
Xorriso_protect_stdout(*xorriso, 0);
} else if(strcmp(leafname, "xorrecord")==0 || strcmp(leafname, "wodim")==0 ||
strcmp(leafname, "cdrecord")==0 || strcmp(leafname, "cdrskin")==0) {
m->argument_emulation= 2;
}
ret= Exclusions_new(&(m->disk_exclusions), 0);
if(ret<=0)
@ -7842,6 +7845,22 @@ int Xorriso_as_genisofs(struct XorrisO *xorriso, int argc, char **argv,
}
int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
{
int end_idx, ret, idx_count, old_idx;
old_idx= *idx;
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 1);
(*idx)= end_idx;
idx_count= end_idx-old_idx;
if(end_idx<=0 || old_idx>=argc)
return(1);
ret= Xorriso_cdrskin(xorriso, "cdrskin", end_idx-old_idx, argv+old_idx, 0);
return(ret);
}
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
Set to NULL if calling this function from outside ISO world
@param flag bit2= -follow: this is not a command parameter
@ -8358,7 +8377,7 @@ int Xorriso_option_as(struct XorrisO *xorriso, int argc, char **argv,
ret= 0; goto ex;
}
if(strcmp(argv[*idx], "cdrecord")==0 || strcmp(argv[*idx], "wodim")==0 ||
strcmp(argv[*idx], "cdrskin")==0) {
strcmp(argv[*idx], "cdrskin")==0 || strcmp(argv[*idx], "xorrecord")==0) {
ret= Xorriso_cdrskin(xorriso, argv[*idx], end_idx-(*idx)-1, argv+(*idx)+1,
0);
if(ret<=0)
@ -12243,14 +12262,15 @@ return:
next_command:;
if(flag&2) {
if(xorriso->argument_emulation==1) {
if(xorriso->argument_emulation==1)
ret= Xorriso_as_genisofs(xorriso, argc, argv, idx, 0);
xorriso->argument_emulation= 0;
if(ret<=0)
goto eval_any_problems;
if((*idx)>=argc)
{ret= 1; goto ex;}
}
else if(xorriso->argument_emulation==2)
ret= Xorriso_as_cdrskin(xorriso, argc, argv, idx, 0);
xorriso->argument_emulation= 0;
if(ret<=0)
goto eval_any_problems;
if((*idx)>=argc)
{ret= 1; goto ex;}
}
xorriso->prepended_wd= 0;
@ -12992,7 +13012,7 @@ protect_stdout:;
} else if(strcmp(cmd,"as")==0 && was_dashed) {
if(strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 ||
strcmp(arg1, "genisofs")==0)
strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0)
goto protect_stdout;
} else {

View File

@ -77,6 +77,7 @@ struct XorrisO { /* the global context of xorriso */
/* Command line argument emulations:
0=xorriso mode
1=mkisofs mode
2=cdrecord mode
*/
int argument_emulation;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.07.10.144535"
#define Xorriso_timestamP "2008.07.10.162809"