New API calls isoburn_attach_start_lba_v2(), isoburn_disc_get_msc1_v2(), isoburn_disc_track_lba_nwa_v2()

This commit is contained in:
Thomas Schmitt 2024-03-09 23:37:12 +01:00
parent 646d15af46
commit dd92a6e0d7
5 changed files with 84 additions and 9 deletions

View File

@ -796,9 +796,9 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
} }
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba) int isoburn_disc_get_msc1_v2(struct burn_drive *d, off_t *start_lba)
{ {
int ret; int ret, int_lba;
struct isoburn *o; struct isoburn *o;
#ifdef Hardcoded_cd_rW #ifdef Hardcoded_cd_rW
@ -824,13 +824,35 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
*start_lba= 0; *start_lba= 0;
return(1); return(1);
} }
return(burn_disc_get_msc1(d, start_lba)); ret= burn_disc_get_msc1(d, &int_lba);
if(ret <= 0)
return(ret);
*start_lba= int_lba;
return(ret);
} }
int isoburn_disc_track_lba_nwa(struct burn_drive *d, int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
{
int ret;
off_t long_lba;
ret= isoburn_disc_get_msc1_v2(d, &long_lba);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*start_lba= 0x7fffffff;
ret= 0;
} else {
*start_lba= long_lba;
}
return(ret);
}
int isoburn_disc_track_lba_nwa_v2(struct burn_drive *d,
struct burn_write_opts *opts, struct burn_write_opts *opts,
int trackno, int *lba, int *nwa) int trackno, off_t *lba, off_t *nwa)
{ {
int ret; int ret;
struct isoburn *o; struct isoburn *o;
@ -858,7 +880,32 @@ int isoburn_disc_track_lba_nwa(struct burn_drive *d,
s= isoburn_disc_get_status(d); s= isoburn_disc_get_status(d);
if(s == BURN_DISC_BLANK) /* We do not believe in anything but nwa = lba = 0 */ if(s == BURN_DISC_BLANK) /* We do not believe in anything but nwa = lba = 0 */
return(1); return(1);
return(burn_disc_track_lba_nwa(d, opts, trackno, lba, nwa)); return(burn_disc_track_lba_nwa_v2(d, opts, trackno, lba, nwa));
}
int isoburn_disc_track_lba_nwa(struct burn_drive *d,
struct burn_write_opts *opts,
int trackno, int *lba, int *nwa)
{
int ret;
off_t long_lba, long_nwa;
ret= isoburn_disc_track_lba_nwa_v2(d, opts, trackno, &long_lba, &long_nwa);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*lba= 0x7fffffff;
} else {
*lba= long_lba;
}
if(long_nwa > 0x7fffffff) {
*nwa= 0x7fffffff;
ret= 0;
} else {
*nwa= long_nwa;
}
return(ret);
} }

View File

@ -594,7 +594,7 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
/* API */ /* API */
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag) int isoburn_attach_start_lba_v2(struct burn_drive *d, off_t lba, int flag)
{ {
int ret; int ret;
struct isoburn *o; struct isoburn *o;
@ -611,6 +611,14 @@ int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
} }
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
{
int ret;
ret= isoburn_attach_start_lba_v2(d, (off_t) lba, flag);
return(ret);
}
/* API function. See libisoburn.h /* API function. See libisoburn.h
*/ */
int isoburn_activate_session(struct burn_drive *drive) int isoburn_activate_session(struct burn_drive *drive)

View File

@ -2592,6 +2592,11 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image);
*/ */
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag); int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag);
/** Like isoburn_attach_start_lba(), but with off_t result value.
@since 1.5.8
*/
int isoburn_attach_start_lba_v2(struct burn_drive *d, off_t lba, int flag);
/** Return the best possible estimation of the currently available capacity of /** Return the best possible estimation of the currently available capacity of
the medium. This might depend on particular write option settings and on the medium. This might depend on particular write option settings and on
@ -2625,6 +2630,11 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
*/ */
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba); int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
/** Like isoburn_disc_get_msc1(), but with off_t result value.
@since 1.5.8
*/
int isoburn_disc_get_msc1_v2(struct burn_drive *d, off_t *start_lba);
/** Use this with trackno==0 to obtain the predicted start block number of the /** Use this with trackno==0 to obtain the predicted start block number of the
new session. The interesting number is returned in parameter nwa. new session. The interesting number is returned in parameter nwa.
@ -2640,6 +2650,13 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
int trackno, int *lba, int *nwa); int trackno, int *lba, int *nwa);
/** Like isoburn_disc_track_lba_nwa(), but with off_t result value.
@since 1.5.8
*/
int isoburn_disc_track_lba_nwa_v2(struct burn_drive *d,
struct burn_write_opts *o,
int trackno, off_t *lba, off_t *nwa);
/** Obtain the size which was attributed to an emulated appendable on actually /** Obtain the size which was attributed to an emulated appendable on actually
overwritable media. This value is supposed to be <= 2048 * nwa as of overwritable media. This value is supposed to be <= 2048 * nwa as of

View File

@ -364,6 +364,9 @@ local: *;
}; };
LIBISOBURN1_1.5.8 { LIBISOBURN1_1.5.8 {
isoburn_attach_start_lba_v2;
isoburn_disc_get_msc1_v2;
isoburn_disc_track_lba_nwa_v2;
isoburn_get_attached_start_lba_v2; isoburn_get_attached_start_lba_v2;
isoburn_get_mount_params_v2; isoburn_get_mount_params_v2;
isoburn_igopt_get_data_start_v2; isoburn_igopt_get_data_start_v2;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.09.212055" #define Xorriso_timestamP "2024.03.09.223619"