Add example test program and some changes to make it work
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libburn.h>
|
||||
#include <libisofs.h>
|
||||
#include <libburn/libburn.h>
|
||||
#include <libisofs/libisofs.h>
|
||||
#include "isoburn.h"
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ int isoburn_new(struct isoburn **objpt, int flag)
|
||||
{
|
||||
struct isoburn *o;
|
||||
int i;
|
||||
int isoburn_new_rwopts(struct isoburn *o);
|
||||
|
||||
*objpt= o= (struct isoburn *) malloc(sizeof(struct isoburn));
|
||||
if(o==NULL)
|
||||
@ -50,7 +49,7 @@ int isoburn_new(struct isoburn **objpt, int flag)
|
||||
o->min_start_byte= 0;
|
||||
o->nwa= 0;
|
||||
o->treatment= 1;
|
||||
o->target_ropts= NULL;
|
||||
o->src= NULL;
|
||||
o->new_wopts= NULL;
|
||||
o->fabricated_disc_status= BURN_DISC_UNREADY;
|
||||
for(i=0;i<65536;i++)
|
||||
@ -227,7 +226,7 @@ int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag)
|
||||
struct isoburn *o;
|
||||
|
||||
*pt= NULL;
|
||||
for(o= isoburn_list_start;o->prev!=NULL;o= o->prev)
|
||||
for(o= isoburn_list_start;o!=NULL;o= o->prev)
|
||||
if(o->drive==d) {
|
||||
*pt= o;
|
||||
return(1);
|
||||
@ -235,3 +234,30 @@ int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc)
|
||||
{
|
||||
struct burn_source *wsrc;
|
||||
struct burn_session *session;
|
||||
struct burn_track *track;
|
||||
struct isoburn *o;
|
||||
int ret;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0)
|
||||
return -1;
|
||||
|
||||
*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);
|
||||
|
||||
track = burn_track_create();
|
||||
burn_track_set_source(track, wsrc);
|
||||
burn_session_add_track(session, track, BURN_POS_END);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user