Removed some outdated ifdef cases

This commit is contained in:
Thomas Schmitt 2008-05-07 07:14:10 +00:00
parent 3eae8634cd
commit 947bb33173
5 changed files with 19 additions and 136 deletions

View File

@ -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);
}

View File

@ -6,8 +6,8 @@
/*
Class core of libisoburn.
Copyright 2007 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2008 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
*/
/* ( derived from stub generated by CgeN on Sat, 01 Sep 2007 12:04:36 GMT ) */
@ -116,13 +116,7 @@ int isoburn_new(struct isoburn **objpt, int flag)
o->min_start_byte= o->zero_nwa * 2048;
o->nwa= o->zero_nwa;
o->truncate= 0;
#ifdef Libisoburn_no_fifO
o->iso_source= NULL;
#else
o->fifo= NULL;
#endif
o->fabricated_disc_status= BURN_DISC_UNREADY;
o->toc= NULL;
o->wrote_well= -1;
@ -167,17 +161,10 @@ int isoburn_destroy(struct isoburn **objpt, int flag)
if(o->image!=NULL)
iso_image_unref(o->image);
if(o->toc!=NULL)
isoburn_toc_entry_destroy(&(o->toc), 1); /* all */
#ifdef Libisoburn_no_fifO
if(o->iso_source!=NULL)
burn_source_free(o->iso_source);
#else
if(o->fifo!=NULL)
burn_source_free(o->fifo);
#endif /* ! Libisoburn_no_fifO */
free((char *) o);
*objpt= NULL;
@ -369,9 +356,7 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
iso_write_opts_set_default_uid(wopts, opts->uid);
iso_write_opts_set_default_gid(wopts, opts->gid);
iso_write_opts_set_output_charset(wopts, opts->output_charset);
#ifdef Libisoburn_no_fifO
iso_write_opts_set_fifo_size(wopts, fifo_chunks);
#endif /* Libisoburn_no_fifO */
if (new_img) {
iso_write_opts_set_ms_block(wopts, 0);
@ -407,28 +392,13 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
/* TODO check return values for failure. propertly clean-up on error */
#ifdef Libisoburn_no_fifO
o->iso_source= wsrc;
#else
o->fifo = burn_fifo_source_new(wsrc, 2048, fifo_chunks, 0);
burn_source_free(wsrc);
if (o->fifo == NULL) {
burn_msgs_submit(0x00060000, "Cannot attach fifo", 0, "FATAL", NULL);
{ret= -1; goto ex;}
}
#endif /* ! Libisoburn_no_fifO */
*disc = burn_disc_create();
session = burn_session_create();
burn_disc_add_session(*disc, session, BURN_POS_END);
track = burn_track_create();
#ifdef Libisoburn_no_fifO
burn_track_set_source(track, o->iso_source);
#else
burn_track_set_source(track, o->fifo);
#endif /* ! Libisoburn_no_fifO */
burn_session_add_track(session, track, BURN_POS_END);
/* give up local references */
@ -459,8 +429,6 @@ int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
ret= isoburn_prepare_disc_aux(d, disc, opts, 1);
if (ret<=0)
return ret;
#ifdef Libisoburn_no_fifO
/* Hand over source reference for optional fifo status inquiry */
if(out_drive==NULL)
return 1;
@ -474,8 +442,6 @@ int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
burn_source_free(out_o->iso_source);
out_o->iso_source= in_o->iso_source;
in_o->iso_source= NULL;
#endif /* Libisoburn_no_fifO */
return 1;
}

View File

@ -10,10 +10,6 @@
#define Isoburn_includeD
/* <<< transition macro */
#define Libisoburn_no_fifO 1
/* for uint8_t */
#include <stdint.h>
@ -73,12 +69,6 @@ struct isoburn {
*/
struct isoburn_toc_entry *toc;
#ifndef Libisoburn_no_fifO
/* The fifo which is installed between track and libisofs burn_source
*/
struct burn_source *fifo;
#endif /* ! Libisoburn_no_fifO */
/* Indicator wether the most recent burn run worked :
-1 = undetermined, ask libburn , 0 = failure , 1 = success
To be inquired by isoburn_drive_wrote_well()
@ -93,12 +83,10 @@ struct isoburn {
/* Libisofs image context */
IsoImage *image;
#ifdef Libisoburn_no_fifO
/* The burn source which transfers data from libisofs to libburn.
It has its own fifo.
*/
struct burn_source *iso_source;
#endif /* Libisoburn_no_fifO */
/* For iso_tree_set_report_callback() */
int (*read_pacifier)(IsoImage*, IsoFileSource*);

View File

@ -6,8 +6,8 @@
/*
libisofs related functions of libisoburn.
Copyright 2007 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2008 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
*/
#include <stdlib.h>
@ -229,15 +229,6 @@ int isoburn_read_image(struct burn_drive *d,
read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features);
read_opts->hasElTorito = iso_read_image_features_has_eltorito(features);
read_opts->size = iso_read_image_features_get_size(features);
#ifdef NIX
read_opts->hasRR = features->hasRR;
read_opts->hasJoliet = features->hasJoliet;
read_opts->hasIso1999 = features->hasIso1999;
read_opts->hasElTorito = features->hasElTorito;
read_opts->size = features->size;
#endif
iso_read_image_features_destroy(features);
return 1;
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.06.144606"
#define Xorriso_timestamP "2008.05.07.071427"