API for volset read, burn_disc creation and sync. write.

Updating of isoburn_start_emulation() to make use of new
isoburn_set_start_byte().
This commit is contained in:
Vreixo Formoso Lopes 2007-09-12 09:25:44 +00:00
parent 77e1d4042a
commit ba0e689ada
2 changed files with 51 additions and 10 deletions

View File

@ -134,16 +134,11 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
/* ok, PVM found, set size */ /* ok, PVM found, set size */
size = (off_t) iso_read_lsb(pvm->vol_space_size, 4); size = (off_t) iso_read_lsb(pvm->vol_space_size, 4);
size *= (off_t) 2048; /* block size in bytes */ size *= (off_t) 2048; /* block size in bytes */
isoburn_set_start_byte(o, size, 0);
// TODO where I get the struct burn_write_opts * from?
// why that function doesn't receive a struct isoburn
isoburn_write_opts_set_start_byte(XXXXXX, size);
} else if (!strncmp((char*)pvm->std_identifier, "CDXX1", 5)) { } else if (!strncmp((char*)pvm->std_identifier, "CDXX1", 5)) {
/* empty image */ /* empty image */
// TODO where I get the struct burn_write_opts * from? isoburn_set_start_byte(o, (off_t) 0, 0);
// why that function doesn't receive a struct isoburn
isoburn_write_opts_set_start_byte(XXXXXX, (off_t) 0);
} else { } else {
// TODO not valid iso image // TODO not valid iso image
// should this be an error? // should this be an error?

View File

@ -84,6 +84,28 @@ int isoburn_disc_erasable(struct burn_drive *d);
*/ */
void isoburn_disc_erase(struct burn_drive *drive, int fast); void isoburn_disc_erase(struct burn_drive *drive, int fast);
/**
* Options for image reading.
*/
struct isoburn_read_opts {
unsigned int norock:1; /*< Do not read Rock Ridge extensions */
unsigned int nojoliet:1; /*< Do not read Joliet extensions */
unsigned int preferjoliet:1;
/*< When both Joliet and RR extensions are present, the RR
* tree is used. If you prefer using Joliet, set this to 1. */
uid_t uid; /**< Default uid when no RR */
gid_t gid; /**< Default uid when no RR */
mode_t mode; /**< Default mode when no RR (only permissions) */
/* modified by the function isoburn_read_volset */
unsigned int hasRR:1; /*< It will be set to 1 if RR extensions are present,
to 0 if not. */
unsigned int hasJoliet:1; /*< It will be set to 1 if Joliet extensions are
present, to 0 if not. */
uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
* the image, as reported in the PVM. */
};
/** Load the ISO filesystem directory tree from the media in the given drive. /** 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 This will give libisoburn the base on which it can let libisofs perform
@ -91,10 +113,18 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast);
to the drive object and is not publicly available. to the drive object and is not publicly available.
Not a wrapper, but peculiar to libisoburn. Not a wrapper, but peculiar to libisoburn.
@param d The drive which holds an existing IOS filesystem @param d The drive which holds an existing IOS filesystem
@read_opts The read options which can be chosen by the application @param read_opts The read options which can be chosen by the application
>>> data type and attributes not defined yet @param volset the volset that represents the image, or NULL if the image is
empty.
<<<<< What about return a volset without file if image is
empty <<<<<<<<<
@return <=0 error , 1 = success
>>>>> error means damaged or unsupported image
error code is stored in ecma119_read_opts in libisofs
also error msgs are enqueued. Any need to pass them to usr? <<<<<<
*/ */
int isoburn_read_volset(struct burn_drive *d, void *read_opts); int isoburn_read_volset(struct burn_drive *d, struct isoburn_read_opts *read_opts,
struct iso_volset **volset);
/** Obtain the start block number of the most recent session on media. In /** Obtain the start block number of the most recent session on media. In
@ -114,6 +144,12 @@ 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);
/** Prepare a disc for writting the new session.
@param disc A burn_disc suitable to pass to isoburn_disc_write.
@return <=0 error , 1 = success
*/
int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc);
/** Start writing of the new session. /** Start writing of the new session.
This call is asynchrounous. I.e. it returns quite soon and the progress has This call is asynchrounous. I.e. it returns quite soon and the progress has
to be watched by a loop with call burn_drive_get_status() until to be watched by a loop with call burn_drive_get_status() until
@ -130,6 +166,16 @@ void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
*/ */
int isoburn_activate_session(struct burn_drive *drive); int isoburn_activate_session(struct burn_drive *drive);
/** Write a new session to a disc.
This is a synchrounous call equivalent to isoburn_prepare_disc +
isoburn_disc_write + isoburn_activate_session
@param pacifier_func If not NULL: a function to produce appeasing messages.
See burn_abort_pacifier() in libburn.h for an example.
*/
int isoburn_perform_write(struct burn_write_opts *o,
int (*pacifier_func)(void *handle, int patience,
int elapsed));
/** Release an aquired drive. /** Release an aquired drive.
Wrapper for: burn_drive_release() Wrapper for: burn_drive_release()