Implementation of isoburn_read_volset().

This commit is contained in:
Vreixo Formoso Lopes 2007-09-12 15:47:26 +00:00
parent 110f22932d
commit 7c64a8dde0

View File

@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "../libisofs/libisofs.h"
#include "../libburn/libburn.h"
@ -79,6 +80,51 @@ uint32_t iso_read_lsb(const uint8_t *buf, int bytes)
return ret;
}
/* API function. See libisoburn.h
*/
int isoburn_read_volset(struct burn_drive *d, struct isoburn_read_opts *read_opts,
struct iso_volset **volset)
{
int ret;
struct ecma119_read_opts ropts;
struct data_source *src;
struct isoburn *o;
assert(d && read_opts && volset);
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0)
return 0;
ret = isoburn_disc_get_msc1(d, &ropts.block);
if (ret < 0)
return -1;
ropts.norock = read_opts->norock;
ropts.nojoliet = read_opts->nojoliet;
ropts.preferjoliet = read_opts->preferjoliet;
ropts.mode = read_opts->mode;
ropts.uid = read_opts->uid;
ropts.gid = read_opts->gid;
src = isoburn_data_source_new(d);
if (!src)
return -2;
*volset = iso_volset_read(src, &ropts);
data_source_free(src);
if (!(*volset))
return -3;
o->target_volset = *volset;
read_opts->hasRR = ropts.hasRR;
read_opts->hasJoliet = ropts.hasJoliet;
return 1;
}
/* API function. See libisoburn.h
*/