From 3e0b8ba42bffd5acab3eeb70b12ef70ecd4f7a96 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 26 Aug 2006 13:49:53 +0000 Subject: [PATCH] Allowed to blank appendable files and installed first back_hacks.h variable ever --- trunk/Makefile.am | 1 + trunk/libburn/back_hacks.h | 54 ++++++++++++++++++++++++++++++++++++++ trunk/libburn/drive.c | 6 ++++- trunk/libburn/init.c | 5 ++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 trunk/libburn/back_hacks.h diff --git a/trunk/Makefile.am b/trunk/Makefile.am index 5b355392..b2d5a51a 100644 --- a/trunk/Makefile.am +++ b/trunk/Makefile.am @@ -11,6 +11,7 @@ libburn_libburn_la_LDFLAGS = \ libburn_libburn_la_SOURCES = \ libburn/async.c \ libburn/async.h \ + libburn/back_hacks.h \ libburn/crc.c \ libburn/crc.h \ libburn/debug.c \ diff --git a/trunk/libburn/back_hacks.h b/trunk/libburn/back_hacks.h new file mode 100644 index 00000000..b086620a --- /dev/null +++ b/trunk/libburn/back_hacks.h @@ -0,0 +1,54 @@ +/** + + This file bundles variables which disable changes in libburn which are + not yet completely accepted. + + The use of these variables is *strongly discouraged* unless you have sincere + reason and are willing to share your gained knowledge with the libburn + developers. + + Do *not silently rely* on these variables with your application. Tell us + that you needed one or more of them. They are subject to removal as soon + as consense has been found about correctness of the change they revoke. + + Value 0 means that the new behavior is enabled. Any other value enables + the described old time behavior. + + If you doubt one of the changes here broke your application, then do + *in your application*, *not here* : + + - #include "libburn/back_hacks.h" like you include "libburn/libburn.h" + + - Set the libburn_back_hack_* variable of your choice to 1. + In your app. Not here. + + - Then start and use libburn as usual. Watch out for results. + + - If you believe to have detected a flaw in our change, come forward + and report it to the libburn developers. Thanks in advance. :) + +*/ + +/** Do not define this macro in your application. Only libburn/init.c is + entitled to set it. +*/ +#ifdef BURN_BACK_HACKS_INIT + + +/** Corresponds to http://libburn.pykix.org/ticket/42 + Reinstates the old ban not to blank appendable CD-RW. We see no reason + for this ban yet. It appears unusual. But maybe it patches a bug. +*/ +int libburn_back_hack_42= 0; + + +#else /* BURN_BACK_HACKS_INIT */ + +/* Note: no application programmer info beyond this point */ + + +extern int libburn_back_hack_42; + +#endif /* ! BURN_BACK_HACKS_INIT */ + + diff --git a/trunk/libburn/drive.c b/trunk/libburn/drive.c index 1f0fb6ad..3aa7a23d 100644 --- a/trunk/libburn/drive.c +++ b/trunk/libburn/drive.c @@ -18,6 +18,7 @@ #include "util.h" #include "sg.h" #include "structure.h" +#include "back_hacks.h" static struct burn_drive drive_array[255]; static int drivetop = -1; @@ -151,7 +152,10 @@ void burn_disc_erase_sync(struct burn_drive *d, int fast) burn_print(1, "erasing drive %s %s\n", d->idata->vendor, d->idata->product); - if (d->status != BURN_DISC_FULL) + /* ts A60825 : allow on parole to blank appendable CDs */ + if ( ! (d->status == BURN_DISC_FULL || + (d->status == BURN_DISC_APPENDABLE && + ! libburn_back_hack_42) ) ) return; d->cancel = 0; d->busy = BURN_DRIVE_ERASING; diff --git a/trunk/libburn/init.c b/trunk/libburn/init.c index 2c5086f4..6e6e29bb 100644 --- a/trunk/libburn/init.c +++ b/trunk/libburn/init.c @@ -10,6 +10,10 @@ #include "libburn.h" #include "drive.h" +/* ts A60825 : The storage location for back_hacks.h variables. */ +#define BURN_BACK_HACKS_INIT 1 +#include "back_hacks.h" + int burn_running = 0; /* ts A60813 : wether to use O_EXCL and/or O_NONBLOCK in libburn/sg.c */ @@ -26,6 +30,7 @@ int burn_sg_open_o_nonblock = 1; to unconditional abort of the process */ int burn_sg_open_abort_busy = 0; + int burn_initialize(void) { if (burn_running)