New API call isoburn_sync_after_write()

This commit is contained in:
Thomas Schmitt 2008-02-04 15:44:53 +00:00
parent ce082db6d2
commit ce43c9e5a2
4 changed files with 34 additions and 5 deletions

View File

@ -414,6 +414,9 @@ int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
} }
/* API @since 0.1.0
@param flag bit0= this is a regular end, not an abort
*/
int isoburn_cancel_prepared_write(struct burn_drive *d, int flag) int isoburn_cancel_prepared_write(struct burn_drive *d, int flag)
{ {
int ret; int ret;
@ -433,6 +436,13 @@ int isoburn_cancel_prepared_write(struct burn_drive *d, int flag)
} }
/* API @since 0.1.0 */
int isoburn_sync_after_write(struct burn_drive *d, int flag)
{
return isoburn_cancel_prepared_write(d, 1);
}
void isoburn_version(int *major, int *minor, int *micro) void isoburn_version(int *major, int *minor, int *micro)
{ {
*major= isoburn_header_version_major; *major= isoburn_header_version_major;

View File

@ -657,7 +657,7 @@ int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte,
@param disc Returns the newly created burn_disc object. @param disc Returns the newly created burn_disc object.
@return <=0 error , 1 = success @return <=0 error , 1 = success
*/ */
int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc, int isoburn_prepare_disc(struct burn_drive *drive, struct burn_disc **disc,
struct isoburn_imgen_opts *opts); struct isoburn_imgen_opts *opts);
@ -686,17 +686,20 @@ int isoburn_prepare_new_image(struct burn_drive *in_drive,
struct isoburn_imgen_opts *opts, struct isoburn_imgen_opts *opts,
struct burn_drive *out_drive); struct burn_drive *out_drive);
/** Revoke isoburn_prepare_new_image() or isoburn_prepare_disc() instead of /** @since 0.1.0
Revoke isoburn_prepare_new_image() or isoburn_prepare_disc() instead of
running isoburn_disc_write(). running isoburn_disc_write().
libisofs reserves resources and maybe already starts generating the libisofs reserves resources and maybe already starts generating the
image stream when one of above two calls is performed. It is mandatory to image stream when one of above two calls is performed. It is mandatory to
either run isoburn_disc_write() or to revoke the preparations by the either run isoburn_disc_write() or to revoke the preparations by the
call described here. call described here.
@param d The input drive which was used with the preparation call. @param input_drive The drive resp. in_drive which was used with the
preparation call.
@param flag Bitfield, submit 0 for now. @param flag Bitfield, submit 0 for now.
bit0= -reserved for internal use-
@return <=0 error , 1 = success @return <=0 error , 1 = success
*/ */
int isoburn_cancel_prepared_write(struct burn_drive *d, int flag); int isoburn_cancel_prepared_write(struct burn_drive *input_drive, int flag);
/** Start writing of the new session. /** Start writing of the new session.
@ -749,6 +752,19 @@ int isoburn_drive_wrote_well(struct burn_drive *d);
int isoburn_activate_session(struct burn_drive *drive); int isoburn_activate_session(struct burn_drive *drive);
/** @since 0.1.0
Wait after normal end of operations until libisofs ended all write
threads and freed resource reservations.
This call is not mandatory. But without it, messages from the ending
threads might appear after the application ended its write procedure.
@param input_drive The drive resp. in_drive which was used with the
preparation call.
@param flag Bitfield, submit 0 for now.
@return <=0 error , 1 = success
*/
int isoburn_sync_after_write(struct burn_drive *input_drive, int flag);
#if 0 #if 0
/* >>> NOT YET IMPLEMENTED <<< */ /* >>> NOT YET IMPLEMENTED <<< */
/** Write a new session to a disc. /** Write a new session to a disc.

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.02.04.093106" #define Xorriso_timestamP "2008.02.04.154405"

View File

@ -838,6 +838,9 @@ no_track:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
goto ex; goto ex;
} }
/* To wait for the end of the libisofs threads and their messages. */
isoburn_sync_after_write(source_drive, 1);
Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n"); sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
Xorriso_info(xorriso, 0); Xorriso_info(xorriso, 0);