New API call isoburn_set_truncate()

This commit is contained in:
Thomas Schmitt 2011-03-21 11:37:03 +00:00
parent 393ad85438
commit 7aaf97653e
4 changed files with 43 additions and 3 deletions

View File

@ -808,6 +808,29 @@ int isoburn_get_msc2(struct isoburn *o,
return(1); 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) void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
{ {

View File

@ -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. @param flag bit0= attempt to load the disc tray.
Else: failure if not loaded. Else: failure if not loaded.
bit1= regard overwriteable media as blank bit1= regard overwriteable media as blank
bit2= if the drive is a regular disk file: truncate it to bit2= if the drive is a regular disk file:
the write start address truncate it to the write start address when writing
begins
bit3= if the drive reports a read-only profile try to read bit3= if the drive reports a read-only profile try to read
table of content by scanning for ISO image headers. table of content by scanning for ISO image headers.
(depending on media type and drive this might (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); 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. /** Start writing of the new session.
This call is asynchrounous. I.e. it returns quite soon and the progress has 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 to be watched by a loop with call burn_drive_get_status() until

View File

@ -86,6 +86,7 @@ isoburn_ropt_set_input_charset;
isoburn_set_msc1; isoburn_set_msc1;
isoburn_set_msgs_submit; isoburn_set_msgs_submit;
isoburn_set_read_pacifier; isoburn_set_read_pacifier;
isoburn_set_truncate;
isoburn_sync_after_write; isoburn_sync_after_write;
isoburn_toc_disc_free; isoburn_toc_disc_free;
isoburn_toc_disc_get_sectors; isoburn_toc_disc_get_sectors;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.03.21.093705" #define Xorriso_timestamP "2011.03.21.113720"