Testwise implementation of libisofs.0.6.3 features

This commit is contained in:
Thomas Schmitt 2008-02-23 10:27:19 +00:00
parent b4470fcc97
commit 5c83a138d4
2 changed files with 90 additions and 11 deletions

View File

@ -731,6 +731,9 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
} }
#define Libisoburn_on_libisofs_after_0_6_2 yes
/* >>> todo: throw out the copies of libdax_msgs entrails */
/* <<< to be replaced by libburn-0.4.3 API call burn_sev_to_text(). /* <<< 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 This is a copy of libdax_msgs__sev_to_text() which is not exposed
@ -752,9 +755,31 @@ int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
#define LIBDAX_MSGS_SEV_ABORT 0x71000000 #define LIBDAX_MSGS_SEV_ABORT 0x71000000
#define LIBDAX_MSGS_SEV_NEVER 0x7fffffff #define LIBDAX_MSGS_SEV_NEVER 0x7fffffff
/* @param flag bit0= -reserved-
bit1= this is a libburn severity
*/
int isoburn__sev_to_text(int severity, char **severity_name, int isoburn__sev_to_text(int severity, char **severity_name,
int flag) 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, 0);
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
if(flag&1) { if(flag&1) {
*severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nERRFILE\nALL"; *severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nERRFILE\nALL";
return(1); return(1);
@ -798,6 +823,17 @@ int isoburn__text_to_sev(char *severity_name, int *severity_number, int flag)
{ {
int ret= 1; int ret= 1;
#ifdef Libisoburn_on_libisofs_after_0_6_2
ret= iso_text_to_sev(severity_name, severity_number, 0);
if(ret>0)
return(ret);
#endif /* Libisoburn_on_libisofs_after_0_6_2 */
#ifdef Libisoburn_on__libburn_after_0_4_2
ret= burn_text_to_sev(severity_name, severity_number, 0);
if(ret>0)
return(ret);
#endif
if(severity_name[0]==0) if(severity_name[0]==0)
*severity_number= 0; *severity_number= 0;
else if(strcmp(severity_name, "MISHAP")==0) else if(strcmp(severity_name, "MISHAP")==0)
@ -826,6 +862,16 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
msg_text_pt= msg_text; msg_text_pt= msg_text;
iso_sev= iso_error_get_severity(iso_error_code); iso_sev= iso_error_get_severity(iso_error_code);
sev_text_pt= min_severity; 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); burn_text_to_sev(min_severity, &min_sev, 0);
/* <<< Tunnel MISHAP through libburn which knows no MISHAP /* <<< Tunnel MISHAP through libburn which knows no MISHAP
@ -837,15 +883,12 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
iso_sev= LIBDAX_MSGS_SEV_DEBUG; iso_sev= LIBDAX_MSGS_SEV_DEBUG;
error_code= 0x00051001; error_code= 0x00051001;
} }
if(min_sev < iso_sev)
if(min_sev < iso_sev) {
/* >>> with libburn-0.4.4 do: burn_sev_to_text(iso_sev, &sev_text_pt, 0); */
isoburn__sev_to_text(iso_sev, &sev_text_pt, 0); 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); 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); return(ret);
} }

View File

@ -21,6 +21,9 @@
#include <fcntl.h> #include <fcntl.h>
#define Xorriso_on_libisofs_after_0_6_2 yes
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifndef Xorriso_standalonE #ifndef Xorriso_standalonE
@ -167,7 +170,7 @@ LIBISOBURN_MISCONFIGURATION_ = 0;
xorriso->libs_are_started= 1; xorriso->libs_are_started= 1;
queue_sev= "DEBUG"; queue_sev= "ALL";
if(xorriso->library_msg_direct_print) { if(xorriso->library_msg_direct_print) {
/* >>> need option for controlling this in XorrisO. /* >>> need option for controlling this in XorrisO.
@ -238,6 +241,8 @@ int Xorriso_get_drive_handles(struct XorrisO *xorriso,
} }
/* >>> todo: throw out the copies of libdax_msgs entrails */
/* <<< to be replaced by libburn-0.4.3 API call burn_sev_to_text(). /* <<< 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 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 by the API of of libburn-0.4.2 . As soon as xorriso gets based on
@ -258,9 +263,29 @@ int Xorriso_get_drive_handles(struct XorrisO *xorriso,
#define LIBDAX_MSGS_SEV_ABORT 0x71000000 #define LIBDAX_MSGS_SEV_ABORT 0x71000000
#define LIBDAX_MSGS_SEV_NEVER 0x7fffffff #define LIBDAX_MSGS_SEV_NEVER 0x7fffffff
int Xorriso__sev_to_text(int severity, char **severity_name, int Xorriso__sev_to_text(int severity, char **severity_name,
int flag) int flag)
{ {
#ifdef Xorriso_on_libisofs_after_0_6_2
int ret;
#else
#ifdef Xorriso_on_libburn_after_0_4_2
int ret;
#endif
#endif
#ifdef Xorriso_on_libisofs_after_0_6_2
ret= iso_sev_to_text(severity, severity_name, 0);
if(ret>0)
return(ret);
#endif /* Xorriso_on_libisofs_after_0_6_2 */
#ifdef Xorriso_on_libburn_after_0_4_2
ret= burn_sev_to_text(severity, severity_name, 0);
if(ret>0)
return(ret);
#endif
if(flag&1) { if(flag&1) {
*severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nALL"; *severity_name= "NEVER\nABORT\nFATAL\nFAILURE\nSORRY\nWARNING\nHINT\nNOTE\nUPDATE\nDEBUG\nALL";
return(1); return(1);
@ -304,6 +329,17 @@ int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
{ {
int ret= 1; int ret= 1;
#ifdef Xorriso_on_libisofs_after_0_6_2
ret= iso_text_to_sev(severity_name, severity_number, 0);
if(ret>0)
return(ret);
#endif /* Xorriso_on_libisofs_after_0_6_2 */
#ifdef Xorriso_on_libburn_after_0_4_2
ret= burn_text_to_sev(severity_name, severity_number, 0);
if(ret>0)
return(ret);
#endif
if(severity_name[0]==0) if(severity_name[0]==0)
*severity_number= 0; *severity_number= 0;
else if(strcmp(severity_name, "MISHAP")==0) else if(strcmp(severity_name, "MISHAP")==0)
@ -346,7 +382,6 @@ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
sev_text_pt= min_severity; sev_text_pt= min_severity;
Xorriso__text_to_sev(min_severity, &min_sev, 0); Xorriso__text_to_sev(min_severity, &min_sev, 0);
if(min_sev < iso_sev) if(min_sev < iso_sev)
/* >>> with libburn-0.4.4 do: burn_sev_to_text(iso_sev, &sev_text_pt, 0); */
Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0); Xorriso__sev_to_text(iso_sev, &sev_text_pt, 0);
strcpy(sfe, msg_text_pt); strcpy(sfe, msg_text_pt);
if(victim[0]) { if(victim[0]) {
@ -366,7 +401,7 @@ int Xorriso_set_image_severities(struct XorrisO *xorriso, int flag)
if(flag&1) if(flag&1)
queue_sev= "UPDATE"; queue_sev= "UPDATE";
else else
queue_sev= "DEBUG"; queue_sev= "ALL";
if(xorriso->library_msg_direct_print) if(xorriso->library_msg_direct_print)
print_sev= xorriso->report_about_text; print_sev= xorriso->report_about_text;
else else
@ -3897,11 +3932,12 @@ int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag)
{ {
int ret; int ret;
/* <<< On MISHAP use FAILURE as abort severity known to libisofs. /* ??? <<< On MISHAP use FAILURE as abort severity known to libisofs.
On ERRFILE use NEVER. On ERRFILE use NEVER.
The pacifier loop will care for canceling libburn on MISHAP The pacifier loop will care for canceling libburn on MISHAP
and thus also cancel the image generation. and thus also cancel the image generation.
with libisofs-0.6.4 this should not be necessary with libisofs-0.6.4 this should not be necessary
Shall it be uphold anyway ?
*/ */
if((flag&1) && strcmp(xorriso->abort_on_text, "MISHAP")==0) if((flag&1) && strcmp(xorriso->abort_on_text, "MISHAP")==0)
ret= iso_set_abort_severity("FAILURE"); ret= iso_set_abort_severity("FAILURE");