legacy/libisoburn/trunk/src/isoburn.h

142 lines
4.5 KiB
C
Raw Normal View History

2007-09-01 18:20:53 +00:00
/*
Class struct of libisoburn.
Copyright 2007 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
*/
2007-09-01 18:20:53 +00:00
#ifndef Isoburn_includeD
#define Isoburn_includeD
/* for uint8_t */
#include <stdint.h>
struct isoburn {
2007-09-06 11:58:51 +00:00
/* The libburn drive to which this isoburn object is related
Most isoburn calls will use a burn_drive as object handle */
2007-09-01 18:20:53 +00:00
struct burn_drive *drive;
2007-09-06 11:58:51 +00:00
/* -1= inappropriate media state detected
0= libburn multi-session media, resp. undecided yet
1= random access media */
2007-09-01 18:20:53 +00:00
int emulation_mode;
2007-09-06 11:58:51 +00:00
/* Although rarely used, libburn can operate on several
drives simultaneously. */
2007-09-01 18:20:53 +00:00
struct isoburn *prev;
struct isoburn *next;
/* --- My part --- */
/* Start address as given by image examination (bytes, not blocks) */
off_t min_start_byte;
/* Aligned start address to be used for processing (counted in blocks) */
int nwa;
2007-09-13 10:29:49 +00:00
/* Eventual freely fabricated isoburn_disc_get_status().
BURN_DISC_UNREADY means that normally emulated status is in effect.
*/
enum burn_disc_status fabricated_disc_status;
2007-09-01 18:20:53 +00:00
/* --- Vreixo's part --- */
/* Expansion treatment strategy: 1= grow, 2= modify, (any use for 0 ?) */
int treatment;
2007-09-06 11:58:51 +00:00
/* The options for reading the old image.
target_ropts.size will contain the number of blocks of the image. */
2007-09-01 18:20:53 +00:00
struct ecma119_read_opts *target_ropts;
2007-09-06 11:58:51 +00:00
/* Buffered ISO head from media (should that become part of
ecma119_read_opts ?) */
2007-09-01 18:20:53 +00:00
uint8_t target_iso_head[65536];
/* The filesystem structure of the old image from media. */
2007-09-04 23:03:21 +00:00
struct iso_volset *target_volset;
2007-09-01 18:20:53 +00:00
2007-09-06 11:58:51 +00:00
/* 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.) */
2007-09-01 18:20:53 +00:00
struct ecma119_source_opts *new_wopts;
};
/* Creation and disposal function */
int isoburn_new(struct isoburn **objpt, int flag);
int isoburn_destroy(struct isoburn **objpt, int flag);
/* Eventual readers for public attributes */
/* ( put into separate .h file then ) */
int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag);
2007-09-04 23:03:21 +00:00
int isoburn_get_target_volset(struct isoburn *o, struct iso_volset **pt,
int flag);
2007-09-01 18:20:53 +00:00
/* 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);
int isoburn_destroy_all(struct isoburn **objpt, int flag);
int isoburn_link(struct isoburn *o, struct isoburn *link, int flag);
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);
2007-09-06 11:58:51 +00:00
2007-09-01 18:20:53 +00:00
/* Non API inner interfaces */
2007-09-06 11:58:51 +00:00
/* Calls from burn_wrap.c into isofs_wrap.c */
2007-09-01 18:20:53 +00:00
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);
2007-09-06 11:58:51 +00:00
/* Calls from isofs_wrap.c into burn_wrap.c */
/** Get an eventual isoburn object which is wrapped around the drive.
@param pt Eventually returns a pointer to the found object.
It is allowed to become NULL if return value is -1 or 0.
2007-09-06 11:58:51 +00:00
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);
2007-09-01 18:20:53 +00:00
/** Set the start address for an emulated add-on session. The value will
be rounded up to the alignment necessary for the media. The aligned
value will be divided by 2048 and then put into o->nwa .
@param o The isoburn object to be programmed.
@param value The start address in bytes
@param flag unused yet
@return <=0 is failure , >0 success
*/
int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag);
/** Get a data source suitable for read from a drive using burn_read_data()
function.
@param d drive to read from. Must be grabbed.
@return the data source, NULL on error. Must be freed with libisofs
data_source_free() function. Note that that doesn't release the
drive.
*/
struct data_source *
isoburn_data_source_new(struct burn_drive *d);
2007-09-01 18:20:53 +00:00
#endif /* Isoburn_includeD */