New API calls isoburn_igopt_set_part_type_guid(), isoburn_igopt_get_part_type_guid(), isoburn_igopt_set_iso_type_guid(), isoburn_igopt_get_iso_type_guid()

This commit is contained in:
2019-02-18 13:03:37 +01:00
parent 122e43da86
commit caf38e81ae
4 changed files with 175 additions and 10 deletions

View File

@ -5,8 +5,8 @@
/*
Lower level API definition of libisoburn.
Copyright 2007-2018 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007-2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007-2019 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -249,7 +249,7 @@ void isoburn_version(int *major, int *minor, int *micro);
*/
#define isoburn_libisofs_req_major 1
#define isoburn_libisofs_req_minor 5
#define isoburn_libisofs_req_micro 0
#define isoburn_libisofs_req_micro 1
/** The minimum version of libburn to be used with this version of libisoburn
at compile time.
@ -1898,7 +1898,6 @@ int isoburn_igopt_set_part_flag(struct isoburn_imgen_opts *opts,
int isoburn_igopt_get_part_flags(struct isoburn_imgen_opts *opts,
int num_entries, int part_flags[]);
/** Control whether partitions created by iso_write_opts_set_partition_img()
are to be represented in MBR or as GPT partitions.
@since 1.4.0
@ -1929,6 +1928,50 @@ int isoburn_igopt_set_appended_as_gpt(struct isoburn_imgen_opts *opts,
int isoburn_igopt_get_appended_as_gpt(struct isoburn_imgen_opts *opts,
int *gpt);
/** Set the GPT Type GUID for a partition defined by
isoburn_igopt_set_partition_img().
@since 1.5.2
@param opts
The option set to be manipulated.
@param partition_number
Depicts the partition table entry which shall get the Type GUID.
@param guid
16 bytes of user supplied GUID. Readily byte-swapped from the text
form as prescribed by UEFI specs:
4 byte, 2 byte, 2 byte as little-endian.
2 byte, 6 byte as big-endian.
@param valid
Set to 1 to make this Type GUID valid.
Set to 0 in order to invalidate a previously made setting. In this
case MBR type 0xEF will become the EFI Type GUID. All others will
become the Basic Data Partition Type GUID.
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_set_part_type_guid(struct isoburn_imgen_opts *opts,
int partition_number, uint8_t guid[16],
int valid);
/** Inquire the current settings made by isoburn_igopt_set_part_type_guid().
@since 1.5.2
@param opts
The option set to be inquired.
@param num_entries
Number of array elements in part_flags[].
@param type_guids
The array elements 0 to num_entries - 1 will get filled by the
16 flag bits of the images of the corresponding partition.
@param valids
The array elements 0 to num_entries - 1 will get filled by 1 or 0
to indicate whether the corresponding type_guids elemet is valid.
@return
<0 = error
0 = no partition image set
>0 highest used partition number
*/
int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts,
int num_entries, uint8_t guids[][16],
int valids[]);
/** Control whether partitions created by iso_write_opts_set_partition_img()
are to be represented in Apple Partition Map.
@ -2018,6 +2061,39 @@ int isoburn_igopt_set_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
int *part_type);
/** Set the GPT Type GUID for the partition which represents the ISO 9660
filesystem, if such a partition emerges in GPT.
@since 1.5.2
@param opts
The option set to be manipulated.
@param guid
16 bytes of user supplied GUID. Readily byte-swapped from the text
form as prescribed by UEFI specs:
4 byte, 2 byte, 2 byte as little-endian.
2 byte, 6 byte as big-endian.
@param valid
Set to 1 to make this Type GUID valid.
Set to 0 in order to invalidate a previously made setting. In this
case the setting of isoburn_igopt_set_iso_mbr_part_type() or its
default gets into effect.
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_set_iso_type_guid(struct isoburn_imgen_opts *opts,
uint8_t guid[16], int valid);
/** Inquire the current setting of isoburn_igopt_set_iso_type_guid().
@since 1.5.2
@param opts
The option set to be inquired.
@param guid
Gets filled with the 16 bytes of GUID.
@return
<= error, 0= guid is invalid, 1 = guid is valid
*/
int isoburn_igopt_get_iso_type_guid(struct isoburn_imgen_opts *opts,
uint8_t guid[16]);
/** Control whether the emerging GPT gets a pseudo-randomly generated disk GUID
or whether it gets a user supplied GUID.
The partition GUIDs will be generated in a reproducible way by exoring a
@ -2026,7 +2102,10 @@ int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
@param opts
The option set to be manipulated.
@param guid
16 bytes of user supplied GUID.
16 bytes of user supplied GUID. Readily byte-swapped from the text
form as prescribed by UEFI specs:
4 byte, 2 byte, 2 byte as little-endian.
2 byte, 6 byte as big-endian.
The upper 4 bit of guid[6] and guid[7] should bear the value 4 to
express the version 4 in both endiannesses. Bit 7 of byte[8] should
be set to 1 and bit 6 be set to 0, in order to express the RFC 4122