From 7aaf97653e9ac0757e6a432406e1d9177d034a41 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 21 Mar 2011 11:37:03 +0000 Subject: [PATCH] New API call isoburn_set_truncate() --- libisoburn/trunk/libisoburn/burn_wrap.c | 23 ++++++++++++++++++++ libisoburn/trunk/libisoburn/libisoburn.h | 20 +++++++++++++++-- libisoburn/trunk/libisoburn/libisoburn.ver | 1 + libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/libisoburn/burn_wrap.c b/libisoburn/trunk/libisoburn/burn_wrap.c index bc7dc6ce..7e48ba0c 100644 --- a/libisoburn/trunk/libisoburn/burn_wrap.c +++ b/libisoburn/trunk/libisoburn/burn_wrap.c @@ -808,6 +808,29 @@ int isoburn_get_msc2(struct isoburn *o, return(1); } +/* @param flag bit0= truncate (else do not truncate) + bit1= do not warn if call is inappropriate to drive + bit2= only set if truncation is currently enabled +*/ +int isoburn_set_truncate(struct burn_drive *drive, int flag) +{ + int ret; + struct isoburn *o; + + ret= isoburn_find_emulator(&o, drive, 0); + if(ret < 0) + return ret; + if(o == NULL) { + if(!(flag & (2 | 4))) + isoburn_msgs_submit(o, 0x00060000, + "Drive type or role is inappropriate for truncation", 0, "WARNING", 0); + return(0); + } + if(o->truncate || !(flag & 4)) + o->truncate= flag & 1; + return(1); +} + void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) { diff --git a/libisoburn/trunk/libisoburn/libisoburn.h b/libisoburn/trunk/libisoburn/libisoburn.h index 65a507ae..0c64e91b 100644 --- a/libisoburn/trunk/libisoburn/libisoburn.h +++ b/libisoburn/trunk/libisoburn/libisoburn.h @@ -403,8 +403,9 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], @param flag bit0= attempt to load the disc tray. Else: failure if not loaded. bit1= regard overwriteable media as blank - bit2= if the drive is a regular disk file: truncate it to - the write start address + bit2= if the drive is a regular disk file: + truncate it to the write start address when writing + begins bit3= if the drive reports a read-only profile try to read table of content by scanning for ISO image headers. (depending on media type and drive this might @@ -1833,6 +1834,21 @@ int isoburn_cancel_prepared_write(struct burn_drive *input_drive, struct burn_drive *output_drive, int flag); +/** + Override the truncation setting that was made with flag bit2 during the + call of isoburn_drive_aquire. This applies only to stdio pseudo drives. + @since 0.1.6 + @param drive The drive which was aquired and shall be used for writing. + @param flag Bitfield controlling the setting: + bit0= truncate (else do not truncate) + bit1= do not warn if call is inappropriate to drive + bit2= only set if truncation is currently enabled + do not warn if call is inappropriate to drive + @return 1 success, 0 inappropriate drive, <0 severe error +*/ +int isoburn_set_truncate(struct burn_drive *drive, int flag); + + /** Start writing of the new session. This call is asynchrounous. I.e. it returns quite soon and the progress has to be watched by a loop with call burn_drive_get_status() until diff --git a/libisoburn/trunk/libisoburn/libisoburn.ver b/libisoburn/trunk/libisoburn/libisoburn.ver index cfca4e3b..1fd11c75 100644 --- a/libisoburn/trunk/libisoburn/libisoburn.ver +++ b/libisoburn/trunk/libisoburn/libisoburn.ver @@ -86,6 +86,7 @@ isoburn_ropt_set_input_charset; isoburn_set_msc1; isoburn_set_msgs_submit; isoburn_set_read_pacifier; +isoburn_set_truncate; isoburn_sync_after_write; isoburn_toc_disc_free; isoburn_toc_disc_get_sectors; diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index a24f502f..156cf978 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.03.21.093705" +#define Xorriso_timestamP "2011.03.21.113720"