New API calls isoburn_get_attached_start_lba(), isoburn_attach_start_lba()
This commit is contained in:
@ -105,6 +105,21 @@ IsoImage *isoburn_get_attached_image(struct burn_drive *d)
|
||||
}
|
||||
|
||||
|
||||
/* API */
|
||||
int isoburn_get_attached_start_lba(struct burn_drive *d)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o= NULL;
|
||||
|
||||
ret = isoburn_find_emulator(&o, d, 0);
|
||||
if (ret < 0 || o == NULL)
|
||||
return -1;
|
||||
if(o->image == NULL)
|
||||
return -1;
|
||||
return o->image_start_lba;
|
||||
}
|
||||
|
||||
|
||||
static void isoburn_idle_free_function(void *ignored)
|
||||
{
|
||||
return;
|
||||
@ -133,6 +148,7 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
if (ret < 0 || o == NULL)
|
||||
{ret= 0; goto ex;}
|
||||
status = isoburn_disc_get_status(d);
|
||||
o->image_start_lba= -1;
|
||||
}
|
||||
if(read_opts==NULL) {
|
||||
isoburn_msgs_submit(o, 0x00060000,
|
||||
@ -193,6 +209,8 @@ create_blank_image:;
|
||||
if (ret <= 0)
|
||||
{ret= -2; goto ex;}
|
||||
ms_block= int_num;
|
||||
if (o != NULL)
|
||||
o->image_start_lba= ms_block;
|
||||
ret = isoburn_read_iso_head(d, int_num, &dummy, NULL, 0);
|
||||
if (ret <= 0) {
|
||||
sprintf(msg, "No ISO 9660 image at LBA %d. Creating blank image.", int_num);
|
||||
@ -312,10 +330,29 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
|
||||
if(o->image != NULL)
|
||||
iso_image_unref(o->image);
|
||||
o->image = image;
|
||||
o->image_start_lba = -1;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* API */
|
||||
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret = isoburn_find_emulator(&o, d, 0);
|
||||
if(ret < 0)
|
||||
return ret;
|
||||
if(o == NULL)
|
||||
return 0;
|
||||
if(o->image == NULL)
|
||||
return 0;
|
||||
o->image_start_lba = lba;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* API function. See libisoburn.h
|
||||
*/
|
||||
int isoburn_activate_session(struct burn_drive *drive)
|
||||
|
Reference in New Issue
Block a user