From 5ec170721e95ff314c4b68507484b790152743cc 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 --- Makefile.am | 1 + libburn/back_hacks.h | 54 ++++++++++++++++++++++++++++++++++++++++++++ libburn/drive.c | 6 ++++- libburn/init.c | 5 ++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 libburn/back_hacks.h diff --git a/Makefile.am b/Makefile.am index 5b35539..b2d5a51 100644 --- a/Makefile.am +++ b/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/libburn/back_hacks.h b/libburn/back_hacks.h new file mode 100644 index 0000000..b086620 --- /dev/null +++ b/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/libburn/drive.c b/libburn/drive.c index 1f0fb6a..3aa7a23 100644 --- a/libburn/drive.c +++ b/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/libburn/init.c b/libburn/init.c index 2c5086f..6e6e29b 100644 --- a/libburn/init.c +++ b/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)