From 1d5a1370beafcc7ac77d7c2a97d9d44a210fdbd9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 10 Jul 2008 16:27:35 +0000 Subject: [PATCH] cdrecord emulation by start names xorrecord, cdrecord, wodim, cdrskin --- libisoburn/trunk/xorriso/xorriso.1 | 19 ++++++---- libisoburn/trunk/xorriso/xorriso.c | 38 +++++++++++++++----- libisoburn/trunk/xorriso/xorriso_private.h | 1 + libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index e70726bf..91ced2ac 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/xorriso.1 @@ -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 diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index b6a67253..9fbf9eeb 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -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 { diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index e71e4dad..d85e9c72 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -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; diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 72f779ba..3faf0ed3 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.07.10.144535" +#define Xorriso_timestamP "2008.07.10.162809"