New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label()

This commit is contained in:
Thomas Schmitt 2010-11-05 14:39:36 +00:00
parent b5cb6347a6
commit 9d5563538b
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_secs_per_head,
opts->partition_heads_per_cyl); opts->partition_heads_per_cyl);
iso_write_opts_set_tail_blocks(wopts, opts->tail_blocks); 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) if(opts->appended_partitions[i] == NULL)
continue; continue;
ret= iso_write_opts_set_partition_img(wopts, i + 1, 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;} {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); ret = iso_image_create_burn_source(in_o->image, wopts, &wsrc);
if (ret < 0) { 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->vol_effective_time= 0;
o->libjte_handle= NULL; o->libjte_handle= NULL;
o->tail_blocks= 0; 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_partitions[i]= NULL;
o->appended_part_types[i]= 0; o->appended_part_types[i]= 0;
} }
@ -960,7 +961,7 @@ int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag)
if(*o==NULL) if(*o==NULL)
return(0); return(0);
for(i= 0; i < 4; i++) for(i= 0; i < Libisoburn_max_appended_partitionS; i++)
if((*o)->appended_partitions[i] != NULL) if((*o)->appended_partitions[i] != NULL)
free((*o)->appended_partitions[i]); free((*o)->appended_partitions[i]);
free(*o); free(*o);
@ -1292,10 +1293,13 @@ int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts,
int partition_number, uint8_t partition_type, int partition_number, uint8_t partition_type,
char *image_path) char *image_path)
{ {
if (partition_number < 1 || partition_number > 4) { char msg[80];
isoburn_msgs_submit(NULL, 0x00060000,
"Partition number is out of range (1...4)", if (partition_number < 1 ||
0, "FAILURE", 0); 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); return(0);
} }
if (opts->appended_partitions[partition_number - 1] != NULL) 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++) for(i= 0; i < num_entries; i++)
image_paths[i]= NULL; 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) if(opts->appended_partitions[i] == NULL)
continue; continue;
if(i < num_entries) { if(i < num_entries) {
@ -1329,3 +1333,18 @@ int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts,
return(max_entry); 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);
}

View File

@ -45,6 +45,17 @@ int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag);
#define Libisoburn_target_head_sizE (32*2048) #define Libisoburn_target_head_sizE (32*2048)
/* Maximum number of appended partitions. Effectively usable number depends
on system area type.
*/
#define Libisoburn_max_appended_partitionS 8
/*
Maximum length of a disc label text plus 1.
*/
#define Libisoburn_disc_label_sizE 129
struct isoburn { struct isoburn {
@ -556,9 +567,12 @@ struct isoburn_imgen_opts {
/* Eventual disk file paths of prepared images which shall be appended /* Eventual disk file paths of prepared images which shall be appended
after the ISO image and described by partiton table entries in a MBR. after the ISO image and described by partiton table entries in a MBR.
*/ */
char *appended_partitions[4]; char *appended_partitions[Libisoburn_max_appended_partitionS];
uint8_t appended_part_types[4]; uint8_t appended_part_types[Libisoburn_max_appended_partitionS];
/* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
*/
char ascii_disc_label[Libisoburn_disc_label_sizE];
}; };

View File

@ -1239,10 +1239,22 @@ int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o,
else: unspecified type else: unspecified type
@since 0.6.4 @since 0.6.4
1= MIPS Big Endian Volume Header 1= MIPS Big Endian Volume Header
>>> EXPERIMENTAL: Submit up to 15 MIPS Big Endian boot files by
Submit MIPS boot image files as El Torito Boot image to iso_image_add_mips_boot_file() of libisofs.
iso_image_set_boot_image() , iso_image_add_boot_image(). This will overwrite the first 512 bytes of
No El Torito info will be produced with system area type 1. the submitted data.
2= DEC Boot Block for MIPS Little Endian
The first boot file submitted by
iso_image_add_mips_boot_file() will be activated.
This will overwrite the first 512 bytes of
the submitted data.
@since 0.6.6
3= SUN Disk Label for SUN SPARC
Submit up to 7 SPARC boot images by
isoburn_igopt_set_partition_img() for partition
numbers 2 to 8.
This will overwrite the first 512 bytes of
the submitted data.
@return 1 success, 0 no data to get, <0 failure @return 1 success, 0 no data to get, <0 failure
*/ */
@ -1375,23 +1387,31 @@ int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts,
/** Cause an arbitrary data file to be appended to the ISO image and to be /** Cause an arbitrary data file to be appended to the ISO image and to be
described by a partition table entry in an MBR at the start of the described by a partition table entry in an MBR or SUN Disk Label at the
ISO image. start of the ISO image.
The partition entry will bear the size of the image file rounded up to The partition entry will bear the size of the image file rounded up to
the next multiple of 2048 bytes. the next multiple of 2048 bytes.
MBR or SUN Disk Label are selected by isoburn_igopt_set_system_area()
system area type: 0 selects MBR partition table. 3 selects a SUN partition
table with 320 kB start alignment.
@since 0.6.4 @since 0.6.4
@param opts @param opts
The option set to be manipulated. The option set to be manipulated.
@param partition_number @param partition_number
Depicts the partition table entry which shall describe the Depicts the partition table entry which shall describe the
appended image. Range 1 to 4. appended image.
1 will cause the whole ISO image to be unclaimable space before Range with MBR: 1 to 4. 1 will cause the whole ISO image to be
partition 1. unclaimable space before partition 1.
@since 0.6.6
Range with SUN Disk Label: 2 to 8.
@param image_path @param image_path
File address in the local file system. File address in the local file system.
With SUN Disk Label: an empty name causes the partition to become
a copy of the next lower partition.
@param image_type @param image_type
The partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06, The MBR partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06,
Linux Native Partition = 0x83. See fdisk command L. Linux Native Partition = 0x83. See fdisk command L.
This parameter is ignored with SUN Disk Label.
@return @return
<=0 = error, 1 = success <=0 = error, 1 = success
*/ */
@ -1410,7 +1430,7 @@ int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts,
image_paths[] of the same index is not NULL. image_paths[] of the same index is not NULL.
@param image_paths @param image_paths
Its elements get filled with either NULL or a pointer to a string Its elements get filled with either NULL or a pointer to a string
with a file address, with a file address resp. an empty text.
@return @return
<0 = error <0 = error
0 = no partition image set 0 = no partition image set
@ -1422,6 +1442,34 @@ int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts,
char *image_paths[]); char *image_paths[]);
/** Set a name for the system area. This setting is ignored unless system area
type 3 "SUN Disk Label" is in effect by iso_write_opts_set_system_area().
In this case it will replace the default text at the start of the image:
"CD-ROM Disc with Sun sparc boot created by libisofs"
@since 0.6.6
@param opts
The option set to be manipulated.
@param label
A text of up to 128 characters.
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label);
/** Inquire the current setting made by isoburn_igopt_set_disc_label().
@since 0.6.6
@param opts
The option set to be inquired.
@param label
Returns a pointer to the currently set label string.
Do not alter this string.
Use only as long as the opts object exists.
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts,
char **label);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* End of Options for image generation */ /* End of Options for image generation */

View File

@ -25,6 +25,7 @@ isoburn_igopt_attach_jte;
isoburn_igopt_destroy; isoburn_igopt_destroy;
isoburn_igopt_detach_jte; isoburn_igopt_detach_jte;
isoburn_igopt_get_data_start; isoburn_igopt_get_data_start;
isoburn_igopt_get_disc_label;
isoburn_igopt_get_effective_lba; isoburn_igopt_get_effective_lba;
isoburn_igopt_get_extensions; isoburn_igopt_get_extensions;
isoburn_igopt_get_fifo_size; isoburn_igopt_get_fifo_size;
@ -40,6 +41,7 @@ isoburn_igopt_get_sort_files;
isoburn_igopt_get_system_area; isoburn_igopt_get_system_area;
isoburn_igopt_get_tail_blocks; isoburn_igopt_get_tail_blocks;
isoburn_igopt_new; isoburn_igopt_new;
isoburn_igopt_set_disc_label;
isoburn_igopt_set_extensions; isoburn_igopt_set_extensions;
isoburn_igopt_set_fifo_size; isoburn_igopt_set_fifo_size;
isoburn_igopt_set_level; isoburn_igopt_set_level;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.11.03.081124" #define Xorriso_timestamP "2010.11.05.143916"