Adapted to libisofs revision 261

This commit is contained in:
Thomas Schmitt 2008-01-23 19:59:46 +00:00
parent e7fa1a3e13
commit 8eede592cb
3 changed files with 14 additions and 24 deletions

View File

@ -50,6 +50,8 @@ extern struct isoburn *isoburn_list_start; /* in isoburn.c */
int isoburn_initialize(void) int isoburn_initialize(void)
{ {
if(iso_init()<0)
return(0);
if(!burn_initialize()) if(!burn_initialize())
return(0); return(0);
isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */ isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */
@ -364,6 +366,7 @@ void isoburn_finish(void)
{ {
isoburn_destroy_all(&isoburn_list_start, 0); isoburn_destroy_all(&isoburn_list_start, 0);
burn_finish(); burn_finish();
iso_finish();
} }

View File

@ -112,9 +112,7 @@ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag)
} else } else
print_sev= "NEVER"; print_sev= "NEVER";
/* >>> NG How to set severities before isoburn_read_image() ? iso_set_msgs_severities(queue_sev, print_sev, "libsofs : ");
iso_image_set_msgs_severities() demands an IsoImage
*/
burn_msgs_set_severities(queue_sev, print_sev, "libburn : "); burn_msgs_set_severities(queue_sev, print_sev, "libburn : ");
/* ??? >>> do we want united queues ? */ /* ??? >>> do we want united queues ? */
@ -171,13 +169,10 @@ int Xorriso_get_drive_handles(struct XorrisO *xorriso,
/* @param flag bit0= suppress DEBUG messages */ /* @param flag bit0= suppress DEBUG messages */
int Xorriso_set_image_severities(struct XorrisO *xorriso, IsoImage *volset, int Xorriso_set_image_severities(struct XorrisO *xorriso, int flag)
int flag)
{ {
char *queue_sev, *print_sev; char *queue_sev, *print_sev;
if(volset==NULL)
return(0);
if(flag&1) if(flag&1)
queue_sev= "UPDATE"; queue_sev= "UPDATE";
else else
@ -186,7 +181,7 @@ int Xorriso_set_image_severities(struct XorrisO *xorriso, IsoImage *volset,
print_sev= xorriso->report_about_text; print_sev= xorriso->report_about_text;
else else
print_sev= "NEVER"; print_sev= "NEVER";
iso_image_set_msgs_severities(volset, queue_sev, print_sev, "libisofs : "); iso_set_msgs_severities(queue_sev, print_sev, "libisofs : ");
return(1); return(1);
} }
@ -235,7 +230,6 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
return(-1); return(-1);
} }
xorriso->in_volset_handle= (void *) volset; xorriso->in_volset_handle= (void *) volset;
Xorriso_set_image_severities(xorriso, volset, 0);
Xorriso_update_volid(xorriso, 0); Xorriso_update_volid(xorriso, 0);
xorriso->volset_change_pending= 0; xorriso->volset_change_pending= 0;
return(1); return(1);
@ -314,7 +308,6 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
if(flag&1) { if(flag&1) {
volset= isoburn_get_attached_image(drive); volset= isoburn_get_attached_image(drive);
if(volset != NULL) { /* The image object is already created */ if(volset != NULL) { /* The image object is already created */
Xorriso_set_image_severities(xorriso, volset, 0);
iso_image_unref(volset); iso_image_unref(volset);
} }
} }
@ -377,16 +370,16 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
ropts.input_charset= NULL; ropts.input_charset= NULL;
ropts.pretend_blank= 0; ropts.pretend_blank= 0;
Xorriso_set_image_severities(xorriso, volset, 1); /* No DEBUG messages */ Xorriso_set_image_severities(xorriso, 1); /* No DEBUG messages */
if(isoburn_read_image(drive, &ropts, &volset) <= 0) { if(isoburn_read_image(drive, &ropts, &volset) <= 0) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
Xorriso_set_image_severities(xorriso, volset, 0); Xorriso_set_image_severities(xorriso, 0);
sprintf(xorriso->info_text,"Cannot read ISO image volset"); sprintf(xorriso->info_text,"Cannot read ISO image volset");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
ret= 3; goto ex; ret= 3; goto ex;
} }
xorriso->in_volset_handle= (void *) volset; xorriso->in_volset_handle= (void *) volset;
Xorriso_set_image_severities(xorriso, volset, 0); Xorriso_set_image_severities(xorriso, 0);
Xorriso_update_volid(xorriso, 0); Xorriso_update_volid(xorriso, 0);
if(xorriso->out_drive_handle != NULL && if(xorriso->out_drive_handle != NULL &&
@ -1331,22 +1324,16 @@ int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag) int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
{ {
int ret, error_code= 0, os_errno= 0, count= 0, pass, start_pass= 0; int ret, error_code= 0, os_errno= 0, count= 0, pass;
char severity[80]; char severity[80];
IsoImage *volume= NULL;
if(xorriso->in_volset_handle==NULL)
start_pass= 1;
else
volume= (IsoImage *) xorriso->in_volset_handle;
if(!xorriso->libs_are_started) if(!xorriso->libs_are_started)
return(1); return(1);
for(pass= start_pass; pass< 2; pass++) { for(pass= 0; pass< 2; pass++) {
while(1) { while(1) {
if(pass==0) if(pass==0)
ret= iso_image_obtain_msgs(volume, "ALL", &error_code, ret= iso_obtain_msgs("ALL", &error_code,
xorriso->info_text, &os_errno, severity); xorriso->info_text, &os_errno, severity);
else else
ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno, ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno,
severity); severity);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.01.22.224321" #define Xorriso_timestamP "2008.01.23.195855"