From 64ceb7c2e9106a333d7ab11f515f959c772b2482 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 26 Jan 2008 11:36:58 +0000 Subject: [PATCH] INCOMPATIBLE API CHANGE: isoburn_initialize(char msg[1024], int flag) --- libisoburn/burn_wrap.c | 19 ++++++++++++++++--- libisoburn/libisoburn.h | 4 +++- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 21 +++++++++++++-------- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/libisoburn/burn_wrap.c b/libisoburn/burn_wrap.c index 74e41251..4386a2d3 100644 --- a/libisoburn/burn_wrap.c +++ b/libisoburn/burn_wrap.c @@ -47,12 +47,25 @@ extern struct isoburn *isoburn_list_start; /* in isoburn.c */ -int isoburn_initialize(void) +int isoburn_initialize(char msg[1024], int flag) { - if(iso_init()<0) + int major, minor, micro; + + msg[0]= 0; + if(iso_init()<0) { + sprintf(msg+strlen(msg), "Cannot initialize libisofs\n"); return(0); - if(!burn_initialize()) + } + iso_lib_version(&major, &minor, µ); + sprintf(msg+strlen(msg), "libisofs version %d.%d.%d , ", major, minor, micro); + + if(!burn_initialize()) { + sprintf(msg+strlen(msg), "Cannot initialize libburn\n"); return(0); + } + burn_version(&major, &minor, µ); + sprintf(msg+strlen(msg), "libburn version %d.%d.%d , ", major, minor, micro); + isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */ return(1); diff --git a/libisoburn/libisoburn.h b/libisoburn/libisoburn.h index 619d60bf..15a9591f 100644 --- a/libisoburn/libisoburn.h +++ b/libisoburn/libisoburn.h @@ -42,9 +42,11 @@ are appropriate for particular target "drives". /** Initialize libisoburn, libisofs and libburn. Wrapper for : iso_init() and burn_initialize() + @param reason A character array for eventual messages (e.g. with errors) + @param flag Bitfield for control purposes (unused yet, submit 0) @return 1 indicates success, 0 is failure */ -int isoburn_initialize(void); +int isoburn_initialize(char msg[1024], int flag); /** Aquire a target drive by its filesystem path resp. libburn persistent diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 5be3b285..887cdcd3 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.01.26.002011" +#define Xorriso_timestamP "2008.01.26.113604" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index 31abcf08..bfd301e2 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -78,7 +78,7 @@ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag) { int ret; char *handler_prefix= NULL; - char *queue_sev, *print_sev; + char *queue_sev, *print_sev, reason[1024]; sprintf(xorriso->info_text, "Starting up libraries ...\n"); Xorriso_info(xorriso, 0); @@ -90,14 +90,25 @@ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag) Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); return(-1); } - ret= isoburn_initialize(); + reason[0]= 0; + ret= isoburn_initialize(reason, 0); if(ret==0) { sprintf(xorriso->info_text, "Cannot initialize libraries"); + if(reason[0]) + sprintf(xorriso->info_text+strlen(xorriso->info_text), + ". Reason given:\n%s", reason); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); free(handler_prefix); return(0); } + + if(reason[0]) { + sprintf(xorriso->info_text, "%s", reason); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); + } + xorriso->libs_are_started= 1; + queue_sev= "DEBUG"; if(xorriso->library_msg_direct_print) { @@ -666,15 +677,9 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, progress.sector, progress.sectors); ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text); if(ret>0 ) - sprintf(xorriso->info_text+strlen(xorriso->info_text), - " [fifo %s, %2d%% fill, size=%d , free=%d]", status_text, - (int) (100.0-100.0*((double) free_bytes)/(double) size), - size, free_bytes); -/* sprintf(xorriso->info_text+strlen(xorriso->info_text), " [fifo %s, %2d%% fill]", status_text, (int) (100.0-100.0*((double) free_bytes)/(double) size)); -*/ } else if(drive_status == BURN_DRIVE_CLOSING_SESSION || drive_status == BURN_DRIVE_CLOSING_TRACK) sprintf(xorriso->info_text,