Removed some outdated ifdef cases
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
*/
|
||||
/* libburn wrappers for libisoburn
|
||||
|
||||
Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007 - 2008 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
*/
|
||||
|
||||
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo
|
||||
@ -38,6 +38,9 @@
|
||||
|
||||
#endif /* Xorriso_standalonE */
|
||||
|
||||
/* <<< remove macro and alternative outdated code */
|
||||
#define Libisoburn_on__libburn_after_0_4_2 yes
|
||||
|
||||
|
||||
#include "libisoburn.h"
|
||||
#include "isoburn.h"
|
||||
@ -545,16 +548,6 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
enum burn_write_types write_type;
|
||||
struct stat stbuf;
|
||||
|
||||
#ifdef NIX
|
||||
/* <<< now in isoburn_is_intermediate_dvd_rw()
|
||||
*/
|
||||
int profile, format_status, num_formats;
|
||||
unsigned bl_sas;
|
||||
off_t format_size= -1;
|
||||
char profile_name[80];
|
||||
enum burn_disc_status s;
|
||||
#endif
|
||||
|
||||
drive= burn_write_opts_get_drive(opts);
|
||||
ret= isoburn_find_emulator(&o, drive, 0);
|
||||
if(ret<0)
|
||||
@ -576,25 +569,8 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
return. The pacifier loop usually happens only afterwards.
|
||||
So automatic formatting might cause a nervous clueless user.
|
||||
*/
|
||||
|
||||
#ifdef NIX
|
||||
/* <<< now in isoburn_is_intermediate_dvd_rw()
|
||||
*/
|
||||
s= isoburn_disc_get_status(drive);
|
||||
ret= burn_disc_get_profile(drive, &profile, profile_name);
|
||||
if(ret>0 && profile==0x13)
|
||||
ret= burn_disc_get_formats(drive, &format_status, &format_size,
|
||||
&bl_sas, &num_formats);
|
||||
if(ret>0 && profile==0x13 && s==BURN_DISC_BLANK && nwa>0 &&
|
||||
nwa <= o->zero_nwa && format_status==BURN_FORMAT_IS_UNKNOWN) {
|
||||
|
||||
#else
|
||||
|
||||
ret= isoburn_is_intermediate_dvd_rw(drive, 0);
|
||||
if(ret>0 && nwa>0 && nwa <= o->zero_nwa) {
|
||||
|
||||
#endif /* ! NIX */
|
||||
|
||||
/* actually this should not happen since such media get recognized
|
||||
by isoburn_welcome_media and o->zero_nwa gets set to 0
|
||||
*/
|
||||
@ -767,15 +743,12 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
#ifdef Libisoburn_no_fifO
|
||||
size_t hsize= 0, hfree_bytes= 0;
|
||||
#endif
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0)
|
||||
return(-1);
|
||||
|
||||
#ifdef Libisoburn_no_fifO
|
||||
if(o==NULL)
|
||||
return(-1);
|
||||
if(o->iso_source==NULL)
|
||||
@ -806,22 +779,15 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
|
||||
*status_text= "ended";
|
||||
else if(ret==7)
|
||||
*status_text= "aborted";
|
||||
#else
|
||||
if(o==NULL)
|
||||
return(0);
|
||||
if(o->fifo==NULL)
|
||||
return(0);
|
||||
ret= burn_fifo_inquire_status(o->fifo, size, free_bytes, status_text);
|
||||
#endif /* ! Libisoburn_no_fifO */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
#define Libisoburn_on_libisofs_after_0_6_2 yes
|
||||
|
||||
/* >>> todo: throw out the copies of libdax_msgs entrails */
|
||||
|
||||
#ifndef Libisoburn_on__libburn_after_0_4_2
|
||||
|
||||
/* <<< to be replaced by libburn-0.4.3 API call burn_sev_to_text().
|
||||
This is a copy of libdax_msgs__sev_to_text() which is not exposed
|
||||
by the API of of libburn-0.4.2 . As soon as xorriso gets based on
|
||||
@ -842,30 +808,24 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
|
||||
#define LIBDAX_MSGS_SEV_ABORT 0x71000000
|
||||
#define LIBDAX_MSGS_SEV_NEVER 0x7fffffff
|
||||
|
||||
#endif /* ! Libisoburn_on__libburn_after_0_4_2 */
|
||||
|
||||
|
||||
/* @param flag bit0= -reserved-
|
||||
bit1= this is a libburn severity
|
||||
*/
|
||||
int isoburn__sev_to_text(int severity, char **severity_name,
|
||||
int flag)
|
||||
{
|
||||
#ifdef Libisoburn_on_libisofs_after_0_6_2
|
||||
int ret;
|
||||
#else
|
||||
#ifdef Libisoburn_on__libburn_after_0_4_2
|
||||
int ret;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef Libisoburn_on_libisofs_after_0_6_2
|
||||
ret= iso_sev_to_text(severity, severity_name);
|
||||
if(ret>0)
|
||||
return(ret);
|
||||
#endif /* Libisoburn_on_libisofs_after_0_6_2 */
|
||||
#ifdef Libisoburn_on__libburn_after_0_4_2
|
||||
ret= burn_sev_to_text(severity, severity_name, 0);
|
||||
if(ret>0)
|
||||
return(ret);
|
||||
#endif
|
||||
return(ret);
|
||||
#else
|
||||
|
||||
if(flag&1) {
|
||||
*severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nERRFILE\nALL";
|
||||
@ -903,6 +863,9 @@ int isoburn__sev_to_text(int severity, char **severity_name,
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
|
||||
#endif /* ! Libisoburn_on__libburn_after_0_4_2 */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -910,11 +873,9 @@ int isoburn__text_to_sev(char *severity_name, int *severity_number, int flag)
|
||||
{
|
||||
int ret= 1;
|
||||
|
||||
#ifdef Libisoburn_on_libisofs_after_0_6_2
|
||||
ret= iso_text_to_sev(severity_name, severity_number);
|
||||
if(ret>0)
|
||||
return(ret);
|
||||
#endif /* Libisoburn_on_libisofs_after_0_6_2 */
|
||||
|
||||
#ifndef Libisoburn_on__libburn_after_0_4_2
|
||||
if(severity_name[0]==0)
|
||||
@ -947,33 +908,10 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
|
||||
msg_text_pt= msg_text;
|
||||
iso_sev= iso_error_get_severity(iso_error_code);
|
||||
sev_text_pt= min_severity;
|
||||
|
||||
#ifdef Libisoburn_on_libisofs_after_0_6_2
|
||||
|
||||
isoburn__text_to_sev(min_severity, &min_sev, 0);
|
||||
if(min_sev < iso_sev)
|
||||
isoburn__sev_to_text(iso_sev, &sev_text_pt, 0);
|
||||
ret= iso_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, 0);
|
||||
|
||||
#else
|
||||
|
||||
burn_text_to_sev(min_severity, &min_sev, 0);
|
||||
|
||||
/* <<< Tunnel MISHAP through libburn which knows no MISHAP
|
||||
with libburn-0.4.4 this is not necessary */
|
||||
if(iso_sev==LIBDAX_MSGS_SEV_MISHAP) {
|
||||
iso_sev= LIBDAX_MSGS_SEV_SORRY;
|
||||
error_code= 0x0005ff73;
|
||||
} else if(iso_sev==LIBDAX_MSGS_SEV_ERRFILE) { /* same with ERRFILE */
|
||||
iso_sev= LIBDAX_MSGS_SEV_DEBUG;
|
||||
error_code= 0x00051001;
|
||||
}
|
||||
if(min_sev < iso_sev)
|
||||
isoburn__sev_to_text(iso_sev, &sev_text_pt, 0);
|
||||
ret= burn_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, NULL);
|
||||
|
||||
#endif /* ! Libisoburn_on_libisofs_after_0_6_2 */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user