Remove unneeded field in struct isoburn

This commit is contained in:
Vreixo Formoso Lopes 2007-09-22 16:53:40 +00:00
parent 0919b40ae9
commit bff450da12
3 changed files with 43 additions and 27 deletions

View File

@ -50,7 +50,6 @@ int isoburn_new(struct isoburn **objpt, int flag)
o->nwa= 0;
o->treatment= 1;
o->src= NULL;
o->new_wopts= NULL;
o->fabricated_disc_status= BURN_DISC_UNREADY;
for(i=0;i<65536;i++)
o->target_iso_head[i]= 0;
@ -240,21 +239,44 @@ int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc)
struct burn_session *session;
struct burn_track *track;
struct isoburn *o;
struct ecma119_source_opts wopts;
int ret;
ret= isoburn_find_emulator(&o, d, 0);
if(ret<0)
return -1;
// TODO check return values for failure. propertly clean-up on error
*disc = burn_disc_create();
session = burn_session_create();
burn_disc_add_session(*disc, session, BURN_POS_END);
// FIXME we need a way to allow users to pass parameters to this!!
o->new_wopts->ms_block = o->nwa;
o->new_wopts->src = o->src;
wsrc = iso_source_new_ecma119(o->target_volset, o->new_wopts);
wopts.volnum = 0;
wopts.level = 2;
wopts.flags = 0;
wopts.relaxed_constraints = 0;
wopts.copy_eltorito = 0;
wopts.no_cache_inodes = 0;
wopts.sort_files = 1;
wopts.default_mode = 0;
wopts.replace_dir_mode = 0;
wopts.replace_file_mode = 0;
wopts.replace_uid = 0;
wopts.replace_gid = 0;
wopts.dir_mode = 0555;
wopts.file_mode = 0555;
wopts.gid = 0;
wopts.uid = 0;
wopts.input_charset = NULL;
wopts.ouput_charset = NULL;
wopts.ms_block = o->nwa;
wopts.src = o->src;
wopts.overwrite = o->target_iso_head;
wsrc = iso_source_new_ecma119(o->target_volset, &wopts);
track = burn_track_create();
burn_track_set_source(track, wsrc);
burn_session_add_track(session, track, BURN_POS_END);

View File

@ -60,15 +60,6 @@ struct isoburn {
/* The filesystem structure of the old image from media. */
struct iso_volset *target_volset;
/* The output options of the current run of libisofs.
Element .overwrite eventually points to a buffered new head
with size fields describing the new size alone, not the
new combined size counted from block 0.
(This head is to be merged with above target_iso_head.) */
struct ecma119_source_opts *new_wopts;
};

View File

@ -146,17 +146,21 @@ int isoburn_activate_session(struct burn_drive *drive)
*/
int isoburn_new_rwopts(struct isoburn *o)
{
struct ecma119_source_opts *wopts;
/* create and initialize new_wopts write options for new image */
wopts = calloc(1, sizeof(struct ecma119_source_opts));
if (!wopts)
return -1;
wopts->overwrite = o->target_iso_head;
o->new_wopts = wopts;
// FIXME
/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
* This should call isoburn_data_source_new(), that now is in
* isoburn_start_emulation(). That is wrong, as for true ms discs
* isoburn_start_emulation() is never called, and thus we haven't a
* source for read previous session volset.
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/* create and initialize the data source */
// o->src = isoburn_data_source_new(o->drive);
// if (!o->src)
// return -1;
return 1;
}
@ -168,11 +172,8 @@ int isoburn_new_rwopts(struct isoburn *o)
*/
int isoburn_free_rwopts(struct isoburn *o)
{
// FIXME I really don't like the data_source_free here.
// isoburn_drive_release() seems a better place
if (o->src)
data_source_free(o->src);
free(o->new_wopts);
return 1;
}
@ -205,10 +206,12 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
return 1;
}
// TODO remove >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* create and initialize the data source */
o->src = isoburn_data_source_new(o->drive);
if (!o->src)
return -1;
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/* check first 64K. If 0's, the disc is treated as a blank disc, and thus
overwritten without extra check. */