Updated to state of discussion

This commit is contained in:
Thomas Schmitt 2007-09-06 11:58:51 +00:00
parent 804391fc44
commit ffc4b67c77
4 changed files with 55 additions and 30 deletions

View File

@ -69,11 +69,15 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
/* >>> recognize unsuitable media */;
}
/* <<< now planned to be done by app
ret = isoburn_read_volset(*o);
if(ret<=0) {
(*o)->emulation_mode= -1;
goto ex;
}
*/
ret= 1;
ex:
if(caps!=NULL)
@ -114,7 +118,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
treatment= 2;
} else if(treatment==1 && ret<=0) {
/* >>> unsuitable media */;
/* >>> unsuitable drive address */;
ret= 0; goto ex;
}
@ -173,7 +177,7 @@ ex:
/** Retrieve media emulation and eventual isoburn emulator of drive.
@return -1 unsuitable media, 0 generic media, 1 emulated media.
*/
static int isoburn_find_emulator(struct isoburn **pt,
int isoburn_find_emulator(struct isoburn **pt,
struct burn_drive *drive, int flag)
{
int ret;

View File

@ -88,13 +88,6 @@ int isoburn_destroy(struct isoburn **objpt, int flag)
/* >>> end mutex */
#ifdef NIX
if(o->stdio_path!=NULL)
free((char *) o->stdio_path);
if(o->stdio_fd!=-1)
close(o->stdio_fd);
#endif
if(o->drive!=NULL)
burn_drive_release(o->drive, 0);
isoburn_free_rwopts(o);

View File

@ -18,19 +18,17 @@
struct isoburn {
/* The libburn drive to which this isoburn object is related */
/* Most isoburn calls will use a burn_drive as object handle */
/* The libburn drive to which this isoburn object is related
Most isoburn calls will use a burn_drive as object handle */
struct burn_drive *drive;
/* -1= inappropriate media state detected */
/* 0= libburn multi-session media, resp. undecided yet */
/* 1= random access media */
/* -1= inappropriate media state detected
0= libburn multi-session media, resp. undecided yet
1= random access media */
int emulation_mode;
/* Although rarely used, libburn can operate on several */
/* drives simultaneously. */
/* >>> I propose to design isoburn as chain link of a list with its */
/* >>> start stored globally. */
/* Although rarely used, libburn can operate on several
drives simultaneously. */
struct isoburn *prev;
struct isoburn *next;
@ -49,21 +47,22 @@ struct isoburn {
/* Expansion treatment strategy: 1= grow, 2= modify, (any use for 0 ?) */
int treatment;
/* The options for reading the old image. */
/* target_ropts.size will contain the number of blocks of the image. */
/* The options for reading the old image.
target_ropts.size will contain the number of blocks of the image. */
struct ecma119_read_opts *target_ropts;
/* Buffered ISO head from media (should that become part of ecma119_read_opts ?) */
/* Buffered ISO head from media (should that become part of
ecma119_read_opts ?) */
uint8_t target_iso_head[65536];
/* 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.) */
/* 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;
@ -79,7 +78,6 @@ int isoburn_destroy(struct isoburn **objpt, int flag);
int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag);
int isoburn_get_target_volset(struct isoburn *o, struct iso_volset **pt,
int flag);
/* List management */
int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag);
int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag);
@ -89,12 +87,30 @@ int isoburn_count(struct isoburn *o, int flag);
int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag);
int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag);
/* Non API inner interfaces */
/* Calls from burn_wrap.c into isofs_wrap.c */
int isoburn_start_emulation(struct isoburn *o, int flag);
int isoburn_new_rwopts(struct isoburn *o);
int isoburn_free_rwopts(struct isoburn *o);
int isoburn_invalidate_iso(struct isoburn *o, int flag);
int isoburn_read_volset(struct isoburn *o);
/* Calls from isofs_wrap.c into burn_wrap.c */
/** Get an eventual isoburn object which is wrapped around the drive.
@param pt Eventually contains a pointer to the found object.
Is allowed to contain NULL if return value is -1 or 0.
In this case, the drive is a genuine libburn drive
with no emulation activated by isoburn.
@param drive The drive to be searched for
@param flag unused yet
@return -1 unsuitable media, 0 generic media, 1 emulated media.
*/
int isoburn_find_emulator(struct isoburn **pt,
struct burn_drive *drive, int flag);
#endif /* Isoburn_includeD */

View File

@ -56,7 +56,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
/** Aquire a drive from the burn_drive_info[] array which was obtained by
a previous call of burn_drive_scan().
a previous call of burn_drive_scan().
Wrapper for: burn_drive_grab()
*/
int isoburn_drive_grab(struct burn_drive *drive, int load);
@ -79,6 +79,18 @@ enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive);
void isoburn_disc_erase(struct burn_drive *drive, int fast);
/** Load the ISO filesystem directory tree from the media in the given drive.
This will give libisoburn the base on which it can let libisofs perform
image growing or image modification. The loaded volset gets attached
to the drive object and is not publicly available.
Not a wrapper, but peculiar to libisoburn.
@param d The drive which holds an existing IOS filesystem
@read_opts The read options which can be chosen by the application
>>> data type and attributes not defined yet
*/
int isoburn_read_volset(struct burn_drive *d, void *read_opts);
/** Obtain the start block number of the most recent session on media. In
case of random access media this will always be 0. Succesfull return is
not a guarantee that there is a ISO-9660 image at all. The call will fail,
@ -108,7 +120,7 @@ void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
/** Call this after isoburn_disc_write has finished and burn_drive_wrote_well()
indicates success. It will eventually complete the emulation of
multi-session functionality, if needed at all. Let libisoburn decide.
Not a wrapper, but peculiar to libburn.
Not a wrapper, but peculiar to libisoburn.
*/
int isoburn_activate_session(struct burn_drive *drive);