New API calls isoburn_toc_disc_get_sectors_v2, isoburn_toc_session_get_sectors_v2, isoburn_toc_track_get_emul_v2

This commit is contained in:
Thomas Schmitt 2024-03-09 19:31:19 +01:00
parent c1e563341d
commit a86d1378ff
4 changed files with 84 additions and 9 deletions

View File

@ -1746,10 +1746,11 @@ failure:;
} }
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc) off_t isoburn_toc_disc_get_sectors_v2(struct isoburn_toc_disc *disc)
{ {
struct isoburn_toc_entry *t; struct isoburn_toc_entry *t;
int ret= 0, num_sessions, num_tracks, open_sessions= 0, session_idx= -1; int num_sessions, num_tracks, open_sessions= 0, session_idx= -1;
off_t ret= 0;
struct burn_session **sessions; struct burn_session **sessions;
struct burn_track **tracks; struct burn_track **tracks;
struct burn_toc_entry entry; struct burn_toc_entry entry;
@ -1780,7 +1781,9 @@ int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
} }
if(num_tracks > 0) { if(num_tracks > 0) {
burn_track_get_entry(tracks[num_tracks - 1], &entry); burn_track_get_entry(tracks[num_tracks - 1], &entry);
if(entry.extensions_valid & 1) if(entry.extensions_valid & 8)
ret= entry.long_start_lba + entry.long_track_blocks;
else if(entry.extensions_valid & 1)
ret= entry.start_lba + entry.track_blocks; ret= entry.start_lba + entry.track_blocks;
} }
} }
@ -1792,6 +1795,17 @@ int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
} }
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
{
off_t ret;
ret= isoburn_toc_disc_get_sectors_v2(disc);
if(ret > 0x7fffffff)
return((int) 0x7fffffff);
return((int) ret);
}
struct isoburn_toc_session **isoburn_toc_disc_get_sessions( struct isoburn_toc_session **isoburn_toc_disc_get_sessions(
struct isoburn_toc_disc *disc, int *num) struct isoburn_toc_disc *disc, int *num)
{ {
@ -1806,10 +1820,11 @@ int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc)
} }
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s) off_t isoburn_toc_session_get_sectors_v2(struct isoburn_toc_session *s)
{ {
struct isoburn_toc_entry *t; struct isoburn_toc_entry *t;
int count= 0, i; int i;
off_t count= 0;
if(s==NULL) if(s==NULL)
return(0); return(0);
@ -1820,11 +1835,22 @@ int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s)
t= t->next; t= t->next;
} }
} else if(s->session!=NULL) } else if(s->session!=NULL)
count= burn_session_get_sectors(s->session); count= burn_session_get_sectors_v2(s->session);
return(count); return(count);
} }
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s)
{
off_t ret;
ret= isoburn_toc_session_get_sectors_v2(s);
if(ret > 0x7fffffff)
return((int) 0x7fffffff);
return((int) ret);
}
int isoburn_toc_entry_finish(struct burn_toc_entry *entry, int isoburn_toc_entry_finish(struct burn_toc_entry *entry,
int session_no, int track_no, int flag) int session_no, int track_no, int flag)
{ {
@ -1896,8 +1922,9 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
} }
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, int isoburn_toc_track_get_emul_v2(struct isoburn_toc_track *t,
int *image_blocks, char volid[33], int flag) off_t *start_lba, off_t *image_blocks,
char volid[33], int flag)
{ {
if(t->toc_entry == NULL) if(t->toc_entry == NULL)
return(0); return(0);
@ -1911,6 +1938,32 @@ int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
} }
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
int *image_blocks, char volid[33], int flag)
{
int ret;
off_t long_lba, long_image_blocks;
ret= isoburn_toc_track_get_emul_v2(t, &long_lba, &long_image_blocks, volid,
flag);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*start_lba= 0x7fffffff;
ret= 0;
} else {
*start_lba= long_lba;
}
if(long_image_blocks > 0x7fffffff) {
*image_blocks= 0x7fffffff;
ret= 0;
} else {
*image_blocks= long_image_blocks;
}
return(ret);
}
void isoburn_toc_disc_free(struct isoburn_toc_disc *d) void isoburn_toc_disc_free(struct isoburn_toc_disc *d)
{ {
if(d->disc!=NULL) if(d->disc!=NULL)

View File

@ -615,6 +615,11 @@ struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d);
*/ */
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc); int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc);
/** Like isoburn_toc_disc_get_sectors(), but with off_t return value.
@since 1.5.8
*/
off_t isoburn_toc_disc_get_sectors_v2(struct isoburn_toc_disc *disc);
/** Get the array of session handles and the number of complete sessions /** Get the array of session handles and the number of complete sessions
from the table of content. from the table of content.
@ -649,6 +654,11 @@ int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc);
*/ */
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s); int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s);
/** Like isoburn_toc_session_get_sectors(), but with off_t return value.
@since 1.5.8
*/
off_t isoburn_toc_session_get_sectors_v2(struct isoburn_toc_session *s);
/** Obtain a copy of the entry which describes the end of a particular session. /** Obtain a copy of the entry which describes the end of a particular session.
Wrapper for: burn_session_get_leadout_entry() Wrapper for: burn_session_get_leadout_entry()
@ -701,6 +711,12 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
int *image_blocks, char volid[33], int flag); int *image_blocks, char volid[33], int flag);
/** Like isoburn_toc_track_get_emul() but with off_t reply type.
@since 1.5.8
*/
int isoburn_toc_track_get_emul_v2(struct isoburn_toc_track *t,
off_t *start_lba, off_t *image_blocks,
char volid[33], int flag);
/** Release the memory associated with a master handle of a medium. /** Release the memory associated with a master handle of a medium.

View File

@ -363,3 +363,9 @@ Xorriso_stop_msg_watcher;
local: *; local: *;
}; };
LIBISOBURN1_1.5.8 {
isoburn_toc_disc_get_sectors_v2;
isoburn_toc_session_get_sectors_v2;
isoburn_toc_track_get_emul_v2;
} LIBISOBURN1;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.09.180620" #define Xorriso_timestamP "2024.03.09.183038"