Enabled multi-session with partition offset

This commit is contained in:
2010-09-10 17:10:03 +00:00
parent 5af8ad46f4
commit d54efd4bc2
6 changed files with 215 additions and 64 deletions

View File

@ -36,20 +36,15 @@ int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt,
int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag);
/* >>> TWINTREE : provisory test of partition offset with emulated TOC.
.target_iso_head must become dynamically allocated
#define Libisoburn_partition_offseT 16
/* Minimal size of target_iso_head which is to be written during
isoburn_activate_session().
TWINTREE:
Within this size there is everything that is needed for image access with
no partition offset. The actual target_iso_head buffer must be larger by
the evential partition offset.
*/
/* Size of target_iso_head which is to be written during
isoburn_activate_session()
*/
#ifdef Libisoburn_partition_offseT
#define Libisoburn_target_head_sizE (32*2048 +Libisoburn_partition_offseT*2048)
#else
#define Libisoburn_target_head_sizE (32*2048)
#endif
struct isoburn {
@ -114,9 +109,14 @@ struct isoburn {
int wrote_well;
/* Buffered ISO head from media (should that become part of
ecma119_read_opts ?) */
uint8_t target_iso_head[Libisoburn_target_head_sizE];
/* ISO head buffer to be filled by write run */
int target_iso_head_size;
uint8_t *target_iso_head;
/* The 2k offset which was read from a loaded image.
*/
uint32_t loaded_partition_offset;
/* Libisofs image context */
IsoImage *image;
@ -253,6 +253,13 @@ isoburn_data_source_new(struct burn_drive *d);
int isoburn_data_source_shutdown(IsoDataSource *src, int flag);
/** TWINTREE:
Check whether size of target_iso_head matches offset.
Eventually adjust size.
*/
int isoburn_adjust_target_iso_head(struct isoburn *o,
uint32_t offst, int flag);
/**
* Options for image reading.
(Comments here may be outdated. API getter/setter function descriptions
@ -576,6 +583,10 @@ struct isoburn_imgen_opts {
written by random access before they were written sequentially.
In this case, no copy of the session 1 header is maintained and no TOC
will be possible. Thus writing begins sequentially at LBA 0.
TWINTREE:
This macro gives the minimal size of an image header. It has to be
enlarged by the eventual partition offset.
*/
#define Libisoburn_overwriteable_starT \
((off_t) (Libisoburn_target_head_sizE/2048))