New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label()

This commit is contained in:
2010-11-05 14:39:36 +00:00
parent f479c73940
commit f18e352251
5 changed files with 106 additions and 23 deletions

View File

@@ -533,7 +533,7 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
opts->partition_secs_per_head,
opts->partition_heads_per_cyl);
iso_write_opts_set_tail_blocks(wopts, opts->tail_blocks);
for(i= 0; i < 4; i++) {
for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
if(opts->appended_partitions[i] == NULL)
continue;
ret= iso_write_opts_set_partition_img(wopts, i + 1,
@@ -545,6 +545,7 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
{ret= -1; goto ex;}
}
}
iso_write_opts_set_disc_label(wopts, opts->ascii_disc_label);
ret = iso_image_create_burn_source(in_o->image, wopts, &wsrc);
if (ret < 0) {
@@ -946,7 +947,7 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
o->vol_effective_time= 0;
o->libjte_handle= NULL;
o->tail_blocks= 0;
for(i= 0; i < 4; i++) {
for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
o->appended_partitions[i]= NULL;
o->appended_part_types[i]= 0;
}
@@ -960,7 +961,7 @@ int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag)
if(*o==NULL)
return(0);
for(i= 0; i < 4; i++)
for(i= 0; i < Libisoburn_max_appended_partitionS; i++)
if((*o)->appended_partitions[i] != NULL)
free((*o)->appended_partitions[i]);
free(*o);
@@ -1292,10 +1293,13 @@ int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts,
int partition_number, uint8_t partition_type,
char *image_path)
{
if (partition_number < 1 || partition_number > 4) {
isoburn_msgs_submit(NULL, 0x00060000,
"Partition number is out of range (1...4)",
0, "FAILURE", 0);
char msg[80];
if (partition_number < 1 ||
partition_number > Libisoburn_max_appended_partitionS) {
sprintf(msg, "Partition number is out of range (1 ... %d)",
Libisoburn_max_appended_partitionS);
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
return(0);
}
if (opts->appended_partitions[partition_number - 1] != NULL)
@@ -1317,7 +1321,7 @@ int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts,
for(i= 0; i < num_entries; i++)
image_paths[i]= NULL;
for(i= 0; i < 4; i++) {
for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
if(opts->appended_partitions[i] == NULL)
continue;
if(i < num_entries) {
@@ -1329,3 +1333,18 @@ int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts,
return(max_entry);
}
int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label)
{
strncpy(opts->ascii_disc_label, label, Libisoburn_disc_label_sizE - 1);
opts->ascii_disc_label[Libisoburn_disc_label_sizE - 1] = 0;
return(1);
}
int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts, char **label)
{
*label= opts->ascii_disc_label;
return(1);
}