libisoburn  1.5.4
About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.
  Fossies Dox: libisoburn-1.5.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libisoburn.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define isoburn_libisofs_req_major   1
 The minimum version of libisofs to be used with this version of libisoburn at compile time. More...
 
#define isoburn_libisofs_req_minor   5
 
#define isoburn_libisofs_req_micro   4
 
#define isoburn_libburn_req_major   1
 The minimum version of libburn to be used with this version of libisoburn at compile time. More...
 
#define isoburn_libburn_req_minor   5
 
#define isoburn_libburn_req_micro   4
 
#define isoburn_header_version_major   1
 These three release version numbers tell the revision of this header file and of the API it describes. More...
 
#define isoburn_header_version_minor   5
 
#define isoburn_header_version_micro   4
 
#define isoburn_ropt_norock   1
 Which existing ISO 9660 extensions in the image to read or not to read. More...
 
#define isoburn_ropt_nojoliet   2
 
#define isoburn_ropt_noiso1999   4
 
#define isoburn_ropt_preferjoliet   8
 
#define isoburn_ropt_pretend_blank   16
 
#define isoburn_ropt_noaaip   32
 
#define isoburn_ropt_noacl   64
 
#define isoburn_ropt_noea   128
 
#define isoburn_ropt_noino   256
 
#define isoburn_ropt_nomd5   512
 
#define isoburn_ropt_nomd5tag   1024
 
#define isoburn_ropt_map_unmapped   ( 2048 | 0 )
 
#define isoburn_ropt_map_stripped   ( 2048 | 4096 )
 
#define isoburn_ropt_map_uppercase   ( 2048 | 8192 )
 
#define isoburn_ropt_map_lowercase   ( 2048 | 12288 )
 
#define isoburn_ropt_joliet_unmapped   ( 16384 | 0)
 
#define isoburn_ropt_joliet_stripped   ( 16384 | 32768)
 
#define isoburn_ropt_has_rockridge   1
 After calling function isoburn_read_image() there are information available in the option set about the size and the available extra trees and extensions in the ISO filesystem. More...
 
#define isoburn_ropt_has_joliet   2
 
#define isoburn_ropt_has_iso1999   4
 
#define isoburn_ropt_has_el_torito   8
 
#define isoburn_igopt_rockridge   1
 Which extensions to support. More...
 
#define isoburn_igopt_joliet   2
 
#define isoburn_igopt_iso1999   4
 
#define isoburn_igopt_hardlinks   8
 
#define isoburn_igopt_aaip   32
 
#define isoburn_igopt_session_md5   64
 
#define isoburn_igopt_file_md5   128
 
#define isoburn_igopt_file_stability   256
 
#define isoburn_igopt_no_emul_toc   512
 
#define isoburn_igopt_will_cancel   1024
 
#define isoburn_igopt_old_empty   2048
 
#define isoburn_igopt_hfsplus   4096
 
#define isoburn_igopt_fat   8192
 
#define isoburn_igopt_omit_version_numbers   1
 Relaxed constraints. More...
 
#define isoburn_igopt_allow_deep_paths   2
 
#define isoburn_igopt_allow_longer_paths   4
 
#define isoburn_igopt_max_37_char_filenames   8
 
#define isoburn_igopt_no_force_dots   16
 
#define isoburn_igopt_allow_lowercase   32
 
#define isoburn_igopt_allow_full_ascii   64
 
#define isoburn_igopt_joliet_longer_paths   128
 
#define isoburn_igopt_always_gmt   256
 
#define isoburn_igopt_rrip_version_1_10   512
 
#define isoburn_igopt_dir_rec_mtime   1024
 
#define isoburn_igopt_aaip_susp_1_10   2048
 
#define isoburn_igopt_only_iso_versions   4096
 
#define isoburn_igopt_no_j_force_dots   8192
 
#define isoburn_igopt_allow_dir_id_ext   16384
 
#define isoburn_igopt_joliet_long_names   32768
 
#define isoburn_igopt_joliet_rec_mtime   0x10000
 
#define isoburn_igopt_iso1999_rec_mtime   0x20000
 
#define isoburn_igopt_allow_7bit_ascii   0x40000
 
#define isoburn_igopt_joliet_utf16   0x80000
 
#define isoburn_igopt_sort_files_by_weight   1
 Whether and how files should be sorted. More...
 

Functions

int isoburn_initialize (char msg[1024], int flag)
 Overview. More...
 
int isoburn_is_compatible (int major, int minor, int micro, int flag)
 Check whether all features of header file libisoburn.h from the given major.minor.micro revision triple can be delivered by the library version which is performing this call. More...
 
void isoburn_version (int *major, int *minor, int *micro)
 Obtain the three release version numbers of the library. More...
 
int isoburn_libisofs_req (int *major, int *minor, int *micro)
 The minimum compile time requirements of libisoburn towards libjte are the same as of a suitable libisofs towards libjte. More...
 
int isoburn_libjte_req (int *major, int *minor, int *micro)
 The minimum version of libjte to be used with this version of libisoburn at runtime. More...
 
int isoburn_libburn_req (int *major, int *minor, int *micro)
 The minimum version of libburn to be used with this version of libisoburn at runtime. More...
 
int isoburn_set_msgs_submit (int(*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag)
 Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time. More...
 
int isoburn_drive_scan_and_grab (struct burn_drive_info *drive_infos[], char *adr, int load)
 Acquire a target drive by its filesystem path or libburn persistent address. More...
 
int isoburn_drive_aquire (struct burn_drive_info *drive_infos[], char *adr, int flag)
 Acquire a target drive by its filesystem path or libburn persistent address. More...
 
int isoburn_drive_grab (struct burn_drive *drive, int load)
 Acquire a drive from the burn_drive_info[] array which was obtained by a previous call of burn_drive_scan(). More...
 
int isoburn_drive_set_msgs_submit (struct burn_drive *d, int(*msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag), void *submit_handle, int submit_flag, int flag)
 Attach to a drive an application provided method for immediate delivery of messages. More...
 
enum burn_disc_status isoburn_disc_get_status (struct burn_drive *drive)
 Inquire the medium status. More...
 
int isoburn_disc_pretend_full_uncond (struct burn_drive *drive)
 Sets the medium status to BURN_DISC_FULL unconditionally. More...
 
int isoburn_disc_erasable (struct burn_drive *d)
 Tells whether the medium can be treated by isoburn_disc_erase(). More...
 
void isoburn_disc_erase (struct burn_drive *drive, int fast)
 Mark the medium as blank. More...
 
int isoburn_set_msc1 (struct burn_drive *d, int adr_mode, char *adr_value, int flag)
 Set up isoburn_disc_get_msc1() to return a fabricated value. More...
 
struct isoburn_toc_discisoburn_toc_drive_get_disc (struct burn_drive *d)
 Obtain a master handle for the table of content. More...
 
int isoburn_toc_disc_get_sectors (struct isoburn_toc_disc *disc)
 Tell the number of 2048 byte blocks covered by the table of content. More...
 
struct isoburn_toc_session ** isoburn_toc_disc_get_sessions (struct isoburn_toc_disc *disc, int *num)
 Get the array of session handles and the number of complete sessions from the table of content. More...
 
int isoburn_toc_disc_get_incmpl_sess (struct isoburn_toc_disc *disc)
 Obtain the number of incomplete sessions which are recorded in the result array of isoburn_toc_disc_get_sessions() after the complete sessions. More...
 
int isoburn_toc_session_get_sectors (struct isoburn_toc_session *s)
 Tell the number of 2048 byte blocks covered by a particular session. More...
 
void isoburn_toc_session_get_leadout_entry (struct isoburn_toc_session *s, struct burn_toc_entry *entry)
 Obtain a copy of the entry which describes the end of a particular session. More...
 
struct isoburn_toc_track ** isoburn_toc_session_get_tracks (struct isoburn_toc_session *s, int *num)
 Get the array of track handles from a particular session. More...
 
void isoburn_toc_track_get_entry (struct isoburn_toc_track *t, struct burn_toc_entry *entry)
 Obtain a copy of the entry which describes a particular track. More...
 
int isoburn_toc_track_get_emul (struct isoburn_toc_track *t, int *start_lba, int *image_blocks, char volid[33], int flag)
 Obtain eventual ISO image parameters of an emulated track. More...
 
void isoburn_toc_disc_free (struct isoburn_toc_disc *disc)
 Release the memory associated with a master handle of a medium. More...
 
int isoburn_read_iso_head (struct burn_drive *d, int lba, int *image_blocks, char *info, int flag)
 Try whether the data at the given address look like a ISO 9660 image header and obtain its alleged size. More...
 
int isoburn_get_mount_params (struct burn_drive *d, int adr_mode, char *adr_value, int *lba, int *track, int *session, char volid[33], int flag)
 Try to convert the given entity address into various entity addresses which would describe it. More...
 
int isoburn_ropt_new (struct isoburn_read_opts **o, int flag)
 Produces a set of image read options, initialized with default values. More...
 
int isoburn_ropt_destroy (struct isoburn_read_opts **o, int flag)
 Deletes an option set which was created by isoburn_ropt_new(). More...
 
int isoburn_ropt_set_data_cache (struct isoburn_read_opts *o, int cache_tiles, int tile_blocks, int flag)
 Sets the size and granularity of the cache which libisoburn provides to libisofs for reading of ISO image data. More...
 
int isoburn_ropt_get_data_cache (struct isoburn_read_opts *o, int *cache_tiles, int *tile_blocks, int *set_flag, int flag)
 Inquire the current settings of isoburn_set_data_cache(). More...
 
int isoburn_ropt_set_extensions (struct isoburn_read_opts *o, int ext)
 
int isoburn_ropt_get_extensions (struct isoburn_read_opts *o, int *ext)
 
int isoburn_ropt_set_default_perms (struct isoburn_read_opts *o, uid_t uid, gid_t gid, mode_t mode)
 Default attributes to use if no RockRidge extension gets loaded. More...
 
int isoburn_ropt_get_default_perms (struct isoburn_read_opts *o, uid_t *uid, gid_t *gid, mode_t *mode)
 
int isoburn_ropt_set_default_dirperms (struct isoburn_read_opts *o, mode_t mode)
 Default attributes to use on directories if no RockRidge extension gets loaded. More...
 
int isoburn_ropt_get_default_dirperms (struct isoburn_read_opts *o, mode_t *mode)
 
int isoburn_ropt_set_input_charset (struct isoburn_read_opts *o, char *input_charset)
 Set the character set for reading RR file names from ISO images. More...
 
int isoburn_ropt_get_input_charset (struct isoburn_read_opts *o, char **input_charset)
 
int isoburn_ropt_set_auto_incharset (struct isoburn_read_opts *o, int mode)
 Enable or disable methods to automatically choose an input charset. More...
 
int isoburn_ropt_get_auto_incharset (struct isoburn_read_opts *o, int *mode)
 
int isoburn_ropt_set_displacement (struct isoburn_read_opts *o, uint32_t displacement, int displacement_sign)
 Control an offset to be applied to all block address pointers in the ISO image in order to compensate for an eventual displacement of the image relative to the start block address for which it was produced. More...
 
int isoburn_ropt_get_displacement (struct isoburn_read_opts *o, uint32_t *displacement, int *displacement_sign)
 
int isoburn_ropt_set_truncate_mode (struct isoburn_read_opts *o, int mode, int length)
 Set the name truncation mode and the maximum name length for imported file objects. More...
 
int isoburn_ropt_get_truncate_mode (struct isoburn_read_opts *o, int *mode, int *length)
 
int isoburn_ropt_get_size_what (struct isoburn_read_opts *o, uint32_t *size, int *has_what)
 
int isoburn_ropt_get_tree_loaded (struct isoburn_read_opts *o, int *tree, int *rr)
 After calling function isoburn_read_image() there are information available in the option set about which tree was used for image loading and whether Rock Ridge information was actually used. More...
 
int isoburn_igopt_new (struct isoburn_imgen_opts **o, int flag)
 Produces a set of generation and transfer options, initialized with default values. More...
 
int isoburn_igopt_destroy (struct isoburn_imgen_opts **o, int flag)
 Deletes an option set which was created by isoburn_igopt_new(). More...
 
int isoburn_igopt_set_level (struct isoburn_imgen_opts *o, int level)
 ISO level to write at. More...
 
int isoburn_igopt_get_level (struct isoburn_imgen_opts *o, int *level)
 
int isoburn_igopt_set_extensions (struct isoburn_imgen_opts *o, int ext)
 
int isoburn_igopt_get_extensions (struct isoburn_imgen_opts *o, int *ext)
 
int isoburn_igopt_set_relaxed (struct isoburn_imgen_opts *o, int relax)
 
int isoburn_igopt_get_relaxed (struct isoburn_imgen_opts *o, int *relax)
 
int isoburn_igopt_set_rr_reloc (struct isoburn_imgen_opts *o, char *name, int flags)
 If not isoburn_igopt_allow_deep_paths is in effect, then it may become necessary to relocate directories so that no ECMA-119 file path has more than 8 components. More...
 
int isoburn_igopt_get_rr_reloc (struct isoburn_imgen_opts *o, char **name, int *flags)
 Obtain the settings of isoburn_igopt_set_rr_reloc(). More...
 
int isoburn_igopt_set_untranslated_name_len (struct isoburn_imgen_opts *o, int len)
 Caution: This option breaks any assumptions about names that are supported by ECMA-119 specifications. More...
 
int isoburn_igopt_get_untranslated_name_len (struct isoburn_imgen_opts *o, int *len)
 
int isoburn_igopt_set_sort_files (struct isoburn_imgen_opts *o, int value)
 
int isoburn_igopt_get_sort_files (struct isoburn_imgen_opts *o, int *value)
 
int isoburn_igopt_set_over_mode (struct isoburn_imgen_opts *o, int replace_dir_mode, int replace_file_mode, mode_t dir_mode, mode_t file_mode)
 Set the override values for files and directory permissions. More...
 
int isoburn_igopt_get_over_mode (struct isoburn_imgen_opts *o, int *replace_dir_mode, int *replace_file_mode, mode_t *dir_mode, mode_t *file_mode)
 
int isoburn_igopt_set_over_ugid (struct isoburn_imgen_opts *o, int replace_uid, int replace_gid, uid_t uid, gid_t gid)
 Set the override values values for group id and user id. More...
 
int isoburn_igopt_get_over_ugid (struct isoburn_imgen_opts *o, int *replace_uid, int *replace_gid, uid_t *uid, gid_t *gid)
 
int isoburn_igopt_set_out_charset (struct isoburn_imgen_opts *o, char *output_charset)
 Set the character set to use for representing RR filenames in the image. More...
 
int isoburn_igopt_get_out_charset (struct isoburn_imgen_opts *o, char **output_charset)
 
int isoburn_igopt_set_fifo_size (struct isoburn_imgen_opts *o, int fifo_size)
 The number of bytes to be used for the fifo which decouples libisofs and libburn for better throughput and for reducing the risk of interrupting signals hitting the libburn thread which operates the MMC drive. More...
 
int isoburn_igopt_get_fifo_size (struct isoburn_imgen_opts *o, int *fifo_size)
 
int isoburn_igopt_get_effective_lba (struct isoburn_imgen_opts *o, int *lba)
 Obtain after image preparation the block address where the session will start on the medium. More...
 
int isoburn_igopt_get_data_start (struct isoburn_imgen_opts *o, int *lba)
 Obtain after image preparation the lowest block address of file content data. More...
 
int isoburn_igopt_set_scdbackup_tag (struct isoburn_imgen_opts *o, char *name, char *timestamp, char *tag_written)
 Set or get parameters "name" and "timestamp" for a scdbackup checksum tag. More...
 
int isoburn_igopt_get_scdbackup_tag (struct isoburn_imgen_opts *o, char name[81], char timestamp[19], char **tag_written)
 
int isoburn_igopt_set_system_area (struct isoburn_imgen_opts *o, char data[32768], int options)
 Attach 32 kB of binary data which shall get written to the first 32 kB of the ISO image, the System Area. More...
 
int isoburn_igopt_get_system_area (struct isoburn_imgen_opts *o, char data[32768], int *options)
 
int isoburn_igopt_set_part_offset (struct isoburn_imgen_opts *opts, uint32_t block_offset_2k, int secs_512_per_head, int heads_per_cyl)
 Control production of a second set of volume descriptors (superblock) and directory trees, together with a partition table in the MBR where the first partition has non-zero start address and the others are zeroed. More...
 
int isoburn_igopt_get_part_offset (struct isoburn_imgen_opts *opts, uint32_t *block_offset_2k, int *secs_512_per_head, int *heads_per_cyl)
 
int isoburn_igopt_set_pvd_times (struct isoburn_imgen_opts *opts, time_t creation_time, time_t modification_time, time_t expiration_time, time_t effective_time, char *uuid)
 Explicitly set the four timestamps of the emerging ISO image. More...
 
int isoburn_igopt_get_pvd_times (struct isoburn_imgen_opts *opts, time_t *creation_time, time_t *modification_time, time_t *expiration_time, time_t *effective_time, char uuid[17])
 
int isoburn_igopt_attach_jte (struct isoburn_imgen_opts *opts, void *libjte_handle)
 Associate a libjte environment object to the upcoming write run. More...
 
int isoburn_igopt_detach_jte (struct isoburn_imgen_opts *opts, void **libjte_handle)
 Remove eventual association to a libjte environment handle. More...
 
int isoburn_igopt_set_tail_blocks (struct isoburn_imgen_opts *opts, uint32_t num_blocks)
 Set or get the number of trailing zero byte blocks to be written by libisofs. More...
 
int isoburn_igopt_get_tail_blocks (struct isoburn_imgen_opts *opts, uint32_t *num_blocks)
 
int isoburn_igopt_set_prep_partition (struct isoburn_imgen_opts *opts, char *path, int flag)
 Copy a data file from the local filesystem into the emerging ISO image. More...
 
int isoburn_igopt_get_prep_partition (struct isoburn_imgen_opts *opts, char **path, int flag)
 
int isoburn_igopt_set_efi_bootp (struct isoburn_imgen_opts *opts, char *path, int flag)
 Copy a data file from the local filesystem into the emerging ISO image and mark it by a GPT entry as EFI system partition. More...
 
int isoburn_igopt_get_efi_bootp (struct isoburn_imgen_opts *opts, char **path, int flag)
 
int isoburn_igopt_set_partition_img (struct isoburn_imgen_opts *opts, int partition_number, uint8_t partition_type, char *image_path)
 Cause an arbitrary data file to be appended to the ISO image and to be described by a partition table entry in an MBR or SUN Disk Label at the start of the ISO image. More...
 
int isoburn_igopt_get_partition_img (struct isoburn_imgen_opts *opts, int num_entries, uint8_t partition_types[], char *image_paths[])
 Inquire the current settings made by isoburn_igopt_set_partition_img(). More...
 
int isoburn_igopt_set_part_flag (struct isoburn_imgen_opts *opts, int partition_number, int flag)
 Set flag bits for a partition defined by isoburn_igopt_set_partition_img(). More...
 
int isoburn_igopt_get_part_flags (struct isoburn_imgen_opts *opts, int num_entries, int part_flags[])
 Inquire the current settings made by isoburn_igopt_set_part_flags(). More...
 
int isoburn_igopt_set_appended_as_gpt (struct isoburn_imgen_opts *opts, int gpt)
 Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in MBR or as GPT partitions. More...
 
int isoburn_igopt_get_appended_as_gpt (struct isoburn_imgen_opts *opts, int *gpt)
 Inquire the current setting made by isoburn_igopt_set_appended_as_gpt(). More...
 
int isoburn_igopt_set_part_type_guid (struct isoburn_imgen_opts *opts, int partition_number, uint8_t guid[16], int valid)
 Set the GPT Type GUID for a partition defined by isoburn_igopt_set_partition_img(). More...
 
int isoburn_igopt_get_part_type_guid (struct isoburn_imgen_opts *opts, int num_entries, uint8_t guids[][16], int valids[])
 Inquire the current settings made by isoburn_igopt_set_part_type_guid(). More...
 
int isoburn_igopt_set_appended_as_apm (struct isoburn_imgen_opts *opts, int apm)
 Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in Apple Partition Map. More...
 
int isoburn_igopt_get_appended_as_apm (struct isoburn_imgen_opts *opts, int *apm)
 Inquire the current setting made by isoburn_igopt_set_appended_as_apm(). More...
 
int isoburn_igopt_set_part_like_isohybrid (struct isoburn_imgen_opts *opts, int alike)
 Control whether bits 2 to 8 of el_torito_set_isolinux_options() shall apply even if not isohybrid MBR patching is enabled (bit1 of parameter options of isoburn_igopt_set_system_area()). More...
 
int isoburn_igopt_get_part_like_isohybrid (struct isoburn_imgen_opts *opts, int *alike)
 Inquire the current setting of isoburn_igopt_set_part_like_isohybrid(). More...
 
int isoburn_igopt_set_iso_mbr_part_type (struct isoburn_imgen_opts *opts, int part_type)
 Set the partition type of the MBR partition which represents the ISO filesystem or at least protects it. More...
 
int isoburn_igopt_get_iso_mbr_part_type (struct isoburn_imgen_opts *opts, int *part_type)
 Inquire the current setting of isoburn_igopt_set_iso_mbr_part_type(). More...
 
int isoburn_igopt_set_iso_type_guid (struct isoburn_imgen_opts *opts, uint8_t guid[16], int valid)
 Set the GPT Type GUID for the partition which represents the ISO 9660 filesystem, if such a partition emerges in GPT. More...
 
int isoburn_igopt_get_iso_type_guid (struct isoburn_imgen_opts *opts, uint8_t guid[16])
 Inquire the current setting of isoburn_igopt_set_iso_type_guid(). More...
 
int isoburn_igopt_set_gpt_guid (struct isoburn_imgen_opts *opts, uint8_t guid[16], int mode)
 Control whether the emerging GPT gets a pseudo-randomly generated disk GUID or whether it gets a user supplied GUID. More...
 
int isoburn_igopt_get_gpt_guid (struct isoburn_imgen_opts *opts, uint8_t guid[16], int *mode)
 Inquire the current setting of isoburn_igopt_set_gpt_guid(). More...
 
int isoburn_igopt_set_disc_label (struct isoburn_imgen_opts *opts, char *label)
 Set a name for the system area. More...
 
int isoburn_igopt_get_disc_label (struct isoburn_imgen_opts *opts, char **label)
 Inquire the current setting made by isoburn_igopt_set_disc_label(). More...
 
int isoburn_igopt_set_hfsp_serial_number (struct isoburn_imgen_opts *opts, uint8_t serial_number[8])
 Set a serial number for the HFS+ extension of the emerging ISO image. More...
 
int isoburn_igopt_get_hfsp_serial_number (struct isoburn_imgen_opts *opts, uint8_t serial_number[8])
 Inquire the current setting made by isoburn_igopt_set_disc_label() More...
 
int isoburn_igopt_set_hfsp_block_size (struct isoburn_imgen_opts *opts, int hfsp_block_size, int apm_block_size)
 Set the allocation block size for HFS+ production and the block size for layout and address unit of Apple Partition map. More...
 
int isoburn_igopt_get_hfsp_block_size (struct isoburn_imgen_opts *opts, int *hfsp_block_size, int *apm_block_size)
 Inquire the current setting made by isoburn_igopt_set_hfsp_block_size. More...
 
int isoburn_igopt_set_write_type (struct isoburn_imgen_opts *opts, int do_tao)
 Set or inquire the write type for the next write run on optical media. More...
 
int isoburn_igopt_get_write_type (struct isoburn_imgen_opts *opts, int *do_tao)
 
int isoburn_igopt_set_stdio_endsync (struct isoburn_imgen_opts *opts, int do_sync)
 Set or inquire whether a final fsync(2) is performed when updating the multi-session information of libburn stdio pseudo-drives by isoburn_activate_session(). More...
 
int isoburn_igopt_get_stdio_endsync (struct isoburn_imgen_opts *opts, int *do_sync)
 
int isoburn_conv_name_chars (struct isoburn_imgen_opts *opts, char *name, size_t name_len, char **result, size_t *result_len, int flag)
 Frontend of libisofs call iso_conv_name_chars() controlled by struct isoburn_imgen_opts rather than IsoWriteOpts. More...
 
IsoImage * isoburn_get_attached_image (struct burn_drive *d)
 Get the image attached to a drive, if any. More...
 
int isoburn_get_attached_start_lba (struct burn_drive *d)
 Get the start address of the image that is attached to the drive, if any. More...
 
int isoburn_read_image (struct burn_drive *d, struct isoburn_read_opts *read_opts, IsoImage **image)
 Load the ISO filesystem directory tree from the medium in the given drive. More...
 
int isoburn_set_read_pacifier (struct burn_drive *drive, int(*read_pacifier)(IsoImage *, IsoFileSource *), void *app_handle)
 Set a callback function for producing pacifier messages during the lengthy process of image reading. More...
 
int isoburn_get_img_partition_offset (struct burn_drive *drive, uint32_t *block_offset_2k)
 Inquire the partition offset of the loaded image. More...
 
int isoburn_attach_image (struct burn_drive *d, IsoImage *image)
 Set the IsoImage to be used with a drive. More...
 
int isoburn_attach_start_lba (struct burn_drive *d, int lba, int flag)
 Set the start address of the image that is attached to the drive, if any. More...
 
off_t isoburn_disc_available_space (struct burn_drive *d, struct burn_write_opts *o)
 Return the best possible estimation of the currently available capacity of the medium. More...
 
int isoburn_disc_get_msc1 (struct burn_drive *d, int *start_lba)
 Obtain the start block number of the most recent session on the medium. More...
 
int isoburn_disc_track_lba_nwa (struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa)
 Use this with trackno==0 to obtain the predicted start block number of the new session. More...
 
int isoburn_get_min_start_byte (struct burn_drive *d, off_t *start_byte, int flag)
 Obtain the size which was attributed to an emulated appendable on actually overwritable media. More...
 
int isoburn_prepare_disc (struct burn_drive *drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts)
 Start production of an ISO 9660 image using the method of Growing: Create a disc object for writing the new session from the created or loaded iso_volset which has been manipulated via libisofs, to the same medium from where the image was eventually loaded. More...
 
int isoburn_prepare_new_image (struct burn_drive *in_drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive)
 Start production of an ISO 9660 image using the method of Modifying: Create a disc object for producing a new image from a previous image plus the changes made by user. More...
 
int isoburn_prepare_blind_grow (struct burn_drive *in_drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive, int nwa)
 Start production of an ISO 9660 image using the method of Blind Growing: Create a disc object for writing an add-on session from the created or loaded IsoImage which has been manipulated via libisofs, to a different drive than the one from where it was loaded. More...
 
int isoburn_cancel_prepared_write (struct burn_drive *input_drive, struct burn_drive *output_drive, int flag)
 Revoke isoburn_prepare_*() instead of running isoburn_disc_write(). More...
 
int isoburn_set_truncate (struct burn_drive *drive, int flag)
 Override the truncation setting that was made with flag bit2 during the call of isoburn_drive_aquire. More...
 
void isoburn_disc_write (struct burn_write_opts *o, struct burn_disc *disc)
 Start writing of the new session. More...
 
int isoburn_get_fifo_status (struct burn_drive *d, int *size, int *free_bytes, char **status_text)
 Inquire state and fill parameters of the fifo which is attached to the emerging track. More...
 
int isoburn_drive_wrote_well (struct burn_drive *d)
 Inquire whether the most recent write run was successful. More...
 
int isoburn_activate_session (struct burn_drive *d)
 Call this after isoburn_disc_write has finished and burn_drive_wrote_well() indicates success. More...
 
int isoburn_sync_after_write (struct burn_drive *input_drive, struct burn_drive *output_drive, int flag)
 Wait after normal end of operations until libisofs ended all write threads and freed resource reservations. More...
 
void isoburn_drive_release (struct burn_drive *drive, int eject)
 Release an acquired drive. More...
 
void isoburn_finish (void)
 Shutdown all three libraries. More...
 
int isoburn_needs_emulation (struct burn_drive *d)
 Inquire whether the medium needs emulation or would be suitable for generic multi-session via libburn. More...
 

Macro Definition Documentation

◆ isoburn_header_version_major

#define isoburn_header_version_major   1

These three release version numbers tell the revision of this header file and of the API it describes.

They are memorized by applications at build time.

Since
0.1.0

Definition at line 313 of file libisoburn.h.

◆ isoburn_header_version_micro

#define isoburn_header_version_micro   4

Definition at line 315 of file libisoburn.h.

◆ isoburn_header_version_minor

#define isoburn_header_version_minor   5

Definition at line 314 of file libisoburn.h.

◆ isoburn_igopt_aaip

#define isoburn_igopt_aaip   32

Definition at line 1244 of file libisoburn.h.

◆ isoburn_igopt_aaip_susp_1_10

#define isoburn_igopt_aaip_susp_1_10   2048

Definition at line 1367 of file libisoburn.h.

◆ isoburn_igopt_allow_7bit_ascii

#define isoburn_igopt_allow_7bit_ascii   0x40000

Definition at line 1374 of file libisoburn.h.

◆ isoburn_igopt_allow_deep_paths

#define isoburn_igopt_allow_deep_paths   2

Definition at line 1357 of file libisoburn.h.

◆ isoburn_igopt_allow_dir_id_ext

#define isoburn_igopt_allow_dir_id_ext   16384

Definition at line 1370 of file libisoburn.h.

◆ isoburn_igopt_allow_full_ascii

#define isoburn_igopt_allow_full_ascii   64

Definition at line 1362 of file libisoburn.h.

◆ isoburn_igopt_allow_longer_paths

#define isoburn_igopt_allow_longer_paths   4

Definition at line 1358 of file libisoburn.h.

◆ isoburn_igopt_allow_lowercase

#define isoburn_igopt_allow_lowercase   32

Definition at line 1361 of file libisoburn.h.

◆ isoburn_igopt_always_gmt

#define isoburn_igopt_always_gmt   256

Definition at line 1364 of file libisoburn.h.

◆ isoburn_igopt_dir_rec_mtime

#define isoburn_igopt_dir_rec_mtime   1024

Definition at line 1366 of file libisoburn.h.

◆ isoburn_igopt_fat

#define isoburn_igopt_fat   8192

Definition at line 1252 of file libisoburn.h.

◆ isoburn_igopt_file_md5

#define isoburn_igopt_file_md5   128

Definition at line 1246 of file libisoburn.h.

◆ isoburn_igopt_file_stability

#define isoburn_igopt_file_stability   256

Definition at line 1247 of file libisoburn.h.

◆ isoburn_igopt_hardlinks

#define isoburn_igopt_hardlinks   8

Definition at line 1243 of file libisoburn.h.

◆ isoburn_igopt_hfsplus

#define isoburn_igopt_hfsplus   4096

Definition at line 1251 of file libisoburn.h.

◆ isoburn_igopt_iso1999

#define isoburn_igopt_iso1999   4

Definition at line 1242 of file libisoburn.h.

◆ isoburn_igopt_iso1999_rec_mtime

#define isoburn_igopt_iso1999_rec_mtime   0x20000

Definition at line 1373 of file libisoburn.h.

◆ isoburn_igopt_joliet

#define isoburn_igopt_joliet   2

Definition at line 1241 of file libisoburn.h.

◆ isoburn_igopt_joliet_long_names

#define isoburn_igopt_joliet_long_names   32768

Definition at line 1371 of file libisoburn.h.

◆ isoburn_igopt_joliet_longer_paths

#define isoburn_igopt_joliet_longer_paths   128

Definition at line 1363 of file libisoburn.h.

◆ isoburn_igopt_joliet_rec_mtime

#define isoburn_igopt_joliet_rec_mtime   0x10000

Definition at line 1372 of file libisoburn.h.

◆ isoburn_igopt_joliet_utf16

#define isoburn_igopt_joliet_utf16   0x80000

Definition at line 1375 of file libisoburn.h.

◆ isoburn_igopt_max_37_char_filenames

#define isoburn_igopt_max_37_char_filenames   8

Definition at line 1359 of file libisoburn.h.

◆ isoburn_igopt_no_emul_toc

#define isoburn_igopt_no_emul_toc   512

Definition at line 1248 of file libisoburn.h.

◆ isoburn_igopt_no_force_dots

#define isoburn_igopt_no_force_dots   16

Definition at line 1360 of file libisoburn.h.

◆ isoburn_igopt_no_j_force_dots

#define isoburn_igopt_no_j_force_dots   8192

Definition at line 1369 of file libisoburn.h.

◆ isoburn_igopt_old_empty

#define isoburn_igopt_old_empty   2048

Definition at line 1250 of file libisoburn.h.

◆ isoburn_igopt_omit_version_numbers

#define isoburn_igopt_omit_version_numbers   1

Relaxed constraints.

Setting any of the bits to 1 break the specifications, but it is supposed to work on most moderns systems. Use with caution.

Since
0.1.0
Parameters
oThe option set to work on
relaxBitfield: bit0= omit_version_numbers Omit the version number (";1") at the end of the ISO-9660 and Joliet identifiers. Version numbers are usually not used by readers. bit1= allow_deep_paths Allow ISO-9660 directory hierarchy to be deeper than 8 levels. bit2= allow_longer_paths Allow path in the ISO-9660 tree to have more than 255 characters. bit3= max_37_char_filenames Allow a single file or directory hierarchy to have up to 37 characters. This is larger than the 31 characters allowed by ISO level 2, and the extra space is taken from the version number, so this also forces omit_version_numbers. bit4= no_force_dots ISO-9660 forces filenames to have a ".", that separates file name from extension. libisofs adds it if original filename has none. Set this to 1 to prevent this behavior. bit5= allow_lowercase Allow lowercase characters in ISO-9660 filenames. By default, only uppercase characters, numbers and a few other characters are allowed. bit6= allow_full_ascii Allow all ASCII characters to be appear on an ISO-9660 filename. Note that "/" and "\0" characters are never allowed, even in RR names. bit7= joliet_longer_paths Allow paths in the Joliet tree to have more than 240 characters. bit8= always_gmt Write timestamps as GMT although the specs prescribe local time with eventual non-zero timezone offset. Negative timezones (west of GMT) can trigger bugs in some operating systems which typically appear in mounted ISO images as if the timezone shift from GMT was applied twice (e.g. in New York 22:36 becomes 17:36). bit9= rrip_version_1_10 Write Rock Ridge info as of specification RRIP-1.10 rather than RRIP-1.12: signature "RRIP_1991A" rather than "IEEE_1282", field PX without file serial number. bit10= dir_rec_mtime Store as ECMA-119 Directory Record timestamp the mtime of the source rather than the image creation time. bit11= aaip_susp_1_10 Write AAIP fields without announcing AAIP by an ER field and without distinguishing RRIP fields from the AAIP field by prefixed ES fields. This saves 5 to 10 bytes per file and might avoid problems with readers which only accept RRIP. SUSP-1.10 allows it, SUSP-1.12 frowns on it. bit12= only_iso_numbers Same as bit1 omit_version_number but restricted to the names in the eventual Joliet tree.
Since
0.5.4 For reasons of backward compatibility it is not possible yet to disable version numbers for ISO 9660 while enabling them for Joliet. bit13= no_j_force_dots Same as no_force_dots but affecting the names in the eventual Joliet tree rather than the ISO 9660 / ECMA-119 names.
0.5.4 Previous versions added dots to Joliet names unconditionally. bit14= allow_dir_id_ext Convert directory names for ECMA-119 similar to other file names, but do not force a dot or add a version number. This violates ECMA-119 by allowing one "." and especially ISO level 1 by allowing DOS style 8.3 names rather than only 8 characters. (mkisofs and its clones obviously do this violation.)
1.0.0 bit15= joliet_long_names Allow for Joliet leaf names up to 103 characters rather than up to 64.
1.0.6 bit16= joliet_rec_mtime Like dir_rec_mtime, but for the Joliet tree.
1.2.0 bit17= iso1999_rec_mtime Like dir_rec_mtime, but for the ISO 9660:1999 tree.
1.2.0 bit18= allow_7bit_ascii Like allow_full_ascii, but only allowing 7-bit characters. Lowercase letters get mapped to uppercase if not allow_lowercase is set. Gets overridden if allow_full_ascii is enabled. bit19= joliet_utf16 Encode Joliet names by character set UTF-16BE rather than UCS-2. The difference is with characters which are not present in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. Both words then stem from a reserved subset of UCS-2.
1.3.6
Returns
1 success, <=0 failure

Definition at line 1356 of file libisoburn.h.

◆ isoburn_igopt_only_iso_versions

#define isoburn_igopt_only_iso_versions   4096

Definition at line 1368 of file libisoburn.h.

◆ isoburn_igopt_rockridge

#define isoburn_igopt_rockridge   1

Which extensions to support.

Since
0.1.0
Parameters
oThe option set to work on
extBitfield: bit0= rockridge Rock Ridge extensions add POSIX file attributes like owner, group, access permissions, long filenames. Very advisable if the designed audience has Unix style systems. bit1= joliet Longer filenames for Windows systems. Weaker than RockRidge, but also readable with GNU/Linux. bit2= iso1999 This is rather exotic. Better do not surprise the readers. bit3= hardlinks Enable hardlink consolidation. IsoNodes which refer to the same source object and have the same properties will get the same ISO image inode numbers. If combined with isoburn_igopt_rrip_version_1_10 below, then the PX entry layout of RRIP-1.12 will be used within RRIP-1.10 (mkisofs does this without causing visible trouble). bit5= aaip The libisofs specific SUSP based extension of ECMA-119 which can encode ACL and XFS-style Extended Attributes. bit6= session_md5
Since
0.4.2 Produce and write MD5 checksum tags of superblock, directory tree, and the whole session stream. bit7= file_md5
0.4.2 Produce and write MD5 checksums for each single IsoFile. bit8= file_stability (only together with file_md5)
0.4.2 Compute MD5 of each file before copying it into the image and compare this with the MD5 of the actual copying. If they do not match then issue MISHAP event. See also libisofs.h iso_write_opts_set_record_md5() bit9= no_emul_toc
0.5.8 On overwritable media or random access files do not write the first session to LBA 32 and do not copy the first 64kB of the first session to LBA 0, but rather write the first session to LBA 0 directly. bit10= will_cancel
0.6.6 Announce to libisofs that only the image size is desired and that the write thread will be cancelled by isoburn_cancel_prepared_write() before actual image writing occurs. Without this, cancellation can cause a MISHAP event. bit11= old_empty
1.0.2 Let symbolic links and device files point to block 0, and let empty data files point to the address of the Volume Descriptor Set Terminator. This was done by libisofs in the past. By default there is now a single dedicated block of zero bytes after the end of the directory trees, of which the address is used for all files without own content. bit12= hfsplus
1.2.4 Produce a HFS+ partition inside the ISO image and announce it by an Apple Partition Map in the System Area. >>> GPT production ? Caution: Interferes with isoburn_igopt_set_system_area() by overwriting the first 8 bytes of the data, and several blocks of 2 KiB after the first one. bit13= fat
1.2.4 >>> Not yet implemented. Planned to co-exist with hfsplus. Produce a FAT32 partition inside the ISO image and announce it by an MBR partition entry in the System Area. Caution: Interferes with isoburn_igopt_set_system_area() by >>> what impact ?
Returns
1 success, <=0 failure

Definition at line 1240 of file libisoburn.h.

◆ isoburn_igopt_rrip_version_1_10

#define isoburn_igopt_rrip_version_1_10   512

Definition at line 1365 of file libisoburn.h.

◆ isoburn_igopt_session_md5

#define isoburn_igopt_session_md5   64

Definition at line 1245 of file libisoburn.h.

◆ isoburn_igopt_sort_files_by_weight

#define isoburn_igopt_sort_files_by_weight   1

Whether and how files should be sorted.

Since
0.1.0
Parameters
oThe option set to work on
valueBitfield: bit0= sort_files_by_weight files should be sorted based on their weight. Weight is attributed to files in the image by libisofs call iso_node_set_sort_weight().
Returns
1 success, <=0 failure

Definition at line 1457 of file libisoburn.h.

◆ isoburn_igopt_will_cancel

#define isoburn_igopt_will_cancel   1024

Definition at line 1249 of file libisoburn.h.

◆ isoburn_libburn_req_major

#define isoburn_libburn_req_major   1

The minimum version of libburn to be used with this version of libisoburn at compile time.

Since
0.1.0

Definition at line 258 of file libisoburn.h.

◆ isoburn_libburn_req_micro

#define isoburn_libburn_req_micro   4

Definition at line 260 of file libisoburn.h.

◆ isoburn_libburn_req_minor

#define isoburn_libburn_req_minor   5

Definition at line 259 of file libisoburn.h.

◆ isoburn_libisofs_req_major

#define isoburn_libisofs_req_major   1

The minimum version of libisofs to be used with this version of libisoburn at compile time.

Since
0.1.0

Definition at line 250 of file libisoburn.h.

◆ isoburn_libisofs_req_micro

#define isoburn_libisofs_req_micro   4

Definition at line 252 of file libisoburn.h.

◆ isoburn_libisofs_req_minor

#define isoburn_libisofs_req_minor   5

Definition at line 251 of file libisoburn.h.

◆ isoburn_ropt_has_el_torito

#define isoburn_ropt_has_el_torito   8

Definition at line 1089 of file libisoburn.h.

◆ isoburn_ropt_has_iso1999

#define isoburn_ropt_has_iso1999   4

Definition at line 1088 of file libisoburn.h.

◆ isoburn_ropt_has_joliet

#define isoburn_ropt_has_joliet   2

Definition at line 1087 of file libisoburn.h.

◆ isoburn_ropt_has_rockridge

#define isoburn_ropt_has_rockridge   1

After calling function isoburn_read_image() there are information available in the option set about the size and the available extra trees and extensions in the ISO filesystem.

This info can be obtained as bits in parameter has_what. Like: joliet_available = (has_what & isoburn_ropt_has_joliet);

Since
0.1.0
Parameters
oThe option set to work on
sizeNumber of image data blocks, 2048 bytes each.
has_whatBitfield: bit0= has_rockridge RockRidge extension info is available in the ISO 9660 tree (POSIX filesystem) bit1= has_joliet Joliet tree is available (suitable for MS-Windows) bit2= has_iso1999 ISO version 2 Enhanced Volume Descriptor aka ISO 9660:1999 and its tree is available. This is rather exotic. bit3= has_el_torito El-Torito boot record is present
Returns
1 success, <=0 failure

Definition at line 1086 of file libisoburn.h.

◆ isoburn_ropt_joliet_stripped

#define isoburn_ropt_joliet_stripped   ( 16384 | 32768)

Definition at line 942 of file libisoburn.h.

◆ isoburn_ropt_joliet_unmapped

#define isoburn_ropt_joliet_unmapped   ( 16384 | 0)

Definition at line 941 of file libisoburn.h.

◆ isoburn_ropt_map_lowercase

#define isoburn_ropt_map_lowercase   ( 2048 | 12288 )

Definition at line 940 of file libisoburn.h.

◆ isoburn_ropt_map_stripped

#define isoburn_ropt_map_stripped   ( 2048 | 4096 )

Definition at line 938 of file libisoburn.h.

◆ isoburn_ropt_map_unmapped

#define isoburn_ropt_map_unmapped   ( 2048 | 0 )

Definition at line 937 of file libisoburn.h.

◆ isoburn_ropt_map_uppercase

#define isoburn_ropt_map_uppercase   ( 2048 | 8192 )

Definition at line 939 of file libisoburn.h.

◆ isoburn_ropt_noaaip

#define isoburn_ropt_noaaip   32

Definition at line 931 of file libisoburn.h.

◆ isoburn_ropt_noacl

#define isoburn_ropt_noacl   64

Definition at line 932 of file libisoburn.h.

◆ isoburn_ropt_noea

#define isoburn_ropt_noea   128

Definition at line 933 of file libisoburn.h.

◆ isoburn_ropt_noino

#define isoburn_ropt_noino   256

Definition at line 934 of file libisoburn.h.

◆ isoburn_ropt_noiso1999

#define isoburn_ropt_noiso1999   4

Definition at line 928 of file libisoburn.h.

◆ isoburn_ropt_nojoliet

#define isoburn_ropt_nojoliet   2

Definition at line 927 of file libisoburn.h.

◆ isoburn_ropt_nomd5

#define isoburn_ropt_nomd5   512

Definition at line 935 of file libisoburn.h.

◆ isoburn_ropt_nomd5tag

#define isoburn_ropt_nomd5tag   1024

Definition at line 936 of file libisoburn.h.

◆ isoburn_ropt_norock

#define isoburn_ropt_norock   1

Which existing ISO 9660 extensions in the image to read or not to read.

Whether to read the content of an existing image at all. The bits can be combined by | and inquired by &.

Since
0.1.0
Parameters
extBitfield: bit0= norock Do not read Rock Ridge extensions bit1= nojoliet Do not read Joliet extensions bit2= noiso1999 Do not read ISO 9660:1999 enhanced tree bit3= preferjoliet When both Joliet and RR extensions are present, the RR tree is used. If you prefer using Joliet, set this to 1. bit4= pretend_blank Always create empty image.Ignore any image on input drive. bit5= noaaip
Since
0.3.4 Do not load AAIP information from image. This information eventually contains ACL or XFS-style Extended Attributes. bit6= noacl
0.3.4 Do not obtain ACL from external filesystem objects (e.g. local filesystem files). bit7= noea
0.3.4 Do not obtain XFS-style Extended Attributes from external filesystem objects (e.g. local filesystem files). bit8= noino
0.4.0 Do not load eventual inode numbers from RRIP entry PX, but generate a new unique inode number for each imported IsoNode object. PX inode numbers mark families of hardlinks by giving all family members the same inode number. libisofs keeps the PX inode numbers unaltered when IsoNode objects get written into an ISO image. bit9= nomd5
0.4.2 Do not load the possibly present MD5 checksum array. Do not check possibly present session_md5 tags. bit10= nomd5tag
1.0.4 Do not check session_md5 tags although bit9 is not set. bit11= do_ecma119_map
1.4.2 Set iso_read_opts_set_ecma119_map() to map_mode rather than relying on the default setting of libisofs. bit12 - bit13= map_mode
1.4.2 How to convert file names if neither Rock Ridge nor Joliet names are present and acceptable. 0 = unmapped: Take name as recorded in ECMA-119 directory record (not suitable for writing them to a new ISO filesystem) 1 = stripped: Like unmapped, but strip off trailing ";1" or ".;1" 2 = uppercase: Like stripped, but map {a-z} to {A-Z} 3 = lowercase: Like stripped, but map {A-Z} to {a-z} bit14= do_joliet_map
1.5.4 Set iso_read_opts_set_joliet_map() to joliet_map_mode rather than relying on the default setting of libisofs. bit15= joliet_map_mode
1.5.4 How to convert Joliet file names. 0 = unmapped: Take name as recorded in Joliet directory record (not suitable for writing them to a new ISO filesystem) 1 = stripped: strip off trailing ";1" or ".;1"
Returns
1 success, <=0 failure

Definition at line 926 of file libisoburn.h.

◆ isoburn_ropt_preferjoliet

#define isoburn_ropt_preferjoliet   8

Definition at line 929 of file libisoburn.h.

◆ isoburn_ropt_pretend_blank

#define isoburn_ropt_pretend_blank   16

Definition at line 930 of file libisoburn.h.

Function Documentation

◆ isoburn_activate_session()

int isoburn_activate_session ( struct burn_drive *  d)

Call this after isoburn_disc_write has finished and burn_drive_wrote_well() indicates success.

It will eventually complete the emulation of multi-session functionality, if needed at all. Let libisoburn decide. Not a wrapper, but peculiar to libisoburn.

Since
0.1.0
Parameters
dThe output drive to which the session was written
Returns
1 success , <=0 failure

Definition at line 393 of file isofs_wrap.c.

394 {
395  int ret, do_sync = 1;
396  struct isoburn *o;
397 
398  ret = isoburn_find_emulator(&o, drive, 0);
399  if (ret < 0)
400  return -1;
401 
402  if (o->emulation_mode != 1)
403  return 1; /* don't need to activate session */
404  if (o->fabricated_msc2 >= 0)
405  return 1; /* blind growing: do not alter anything outside the session */
406 
407  if (!(o->fabricated_disc_status == BURN_DISC_APPENDABLE ||
408  (o->fabricated_disc_status == BURN_DISC_BLANK &&
409  o->zero_nwa > 0)))
410  return 1;
411  ret = burn_drive_get_drive_role(drive);
412  if (ret != 1)
413  do_sync = !! o->do_fsync;
414 
415  ret = burn_random_access_write(drive, (off_t) 0, (char*)o->target_iso_head,
416  o->target_iso_head_size, do_sync);
417 
418  return ret;
419 }
int isoburn_find_emulator(struct isoburn **pt, struct burn_drive *drive, int flag)
Retrieve medium emulation and eventual isoburn emulator of drive.
Definition: burn_wrap.c:627
uint8_t * target_iso_head
Definition: isoburn.h:134
int do_fsync
Definition: isoburn.h:172
struct burn_drive * drive
Definition: isoburn.h:70
int emulation_mode
Definition: isoburn.h:75
int fabricated_msc2
Definition: isoburn.h:92
enum burn_disc_status fabricated_disc_status
Definition: isoburn.h:114
int zero_nwa
Definition: isoburn.h:98
int target_iso_head_size
Definition: isoburn.h:133

References isoburn::do_fsync, isoburn::drive, isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn::fabricated_msc2, isoburn_find_emulator(), isoburn::target_iso_head, isoburn::target_iso_head_size, and isoburn::zero_nwa.

Referenced by isoburn_invalidate_iso(), and Xorriso_write_session().

◆ isoburn_attach_image()

int isoburn_attach_image ( struct burn_drive *  d,
IsoImage *  image 
)

Set the IsoImage to be used with a drive.

This eventually releases the reference to the old IsoImage attached to the drive. Caution: Use with care. It hardly makes sense to replace an image that reflects a valid ISO image on the medium. This call is rather intended for writing a newly created and populated image to blank media. The use case in xorriso is to let an image survive the change or demise of the outdev target drive.

Since
0.1.0
Parameters
dThe drive which shall be write target of the volset.
imageThe image that represents the image to be written. This image pointer MUST already be a valid reference suitable for iso_image_unref(). It may have been obtained by appropriate libisofs calls or by isoburn_read_image() with d==NULL.
Returns
<=0 error , 1 = success

Definition at line 351 of file isofs_wrap.c.

352 {
353  int ret;
354  struct isoburn *o;
355 
356  ret = isoburn_find_emulator(&o, d, 0);
357  if (ret < 0 || o == NULL)
358  return 0;
359  if (image == NULL) {
360  isoburn_msgs_submit(o, 0x00060000,
361  "Program error: isoburn_attach_image: image==NULL",
362  0, "FATAL", 0);
363  return -1;
364  }
365  if(o->image != NULL)
366  iso_image_unref(o->image);
367  o->image = image;
368  o->image_start_lba = -1;
369  return(1);
370 }
int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[], int os_errno, char severity[], int flag)
Definition: isoburn.c:340
int image_start_lba
Definition: isoburn.h:145
IsoImage * image
Definition: isoburn.h:142

References isoburn::image, isoburn::image_start_lba, isoburn_find_emulator(), and isoburn_msgs_submit().

Referenced by Xorriso_aquire_drive().

◆ isoburn_attach_start_lba()

int isoburn_attach_start_lba ( struct burn_drive *  d,
int  lba,
int  flag 
)

Set the start address of the image that is attached to the drive, if any.

Since
1.2.2
Parameters
dThe drive to inquire
lbaThe logical block address where the System Area of the image starts. <0 means that the address is invalid.
flagBitfield, submit 0 for now.
Returns
<=0 error (e.g. because no image is attached), 1 = success

Definition at line 374 of file isofs_wrap.c.

375 {
376  int ret;
377  struct isoburn *o;
378 
379  ret = isoburn_find_emulator(&o, d, 0);
380  if(ret < 0)
381  return ret;
382  if(o == NULL)
383  return 0;
384  if(o->image == NULL)
385  return 0;
386  o->image_start_lba = lba;
387  return 1;
388 }

References isoburn::image, isoburn::image_start_lba, and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive().

◆ isoburn_cancel_prepared_write()

int isoburn_cancel_prepared_write ( struct burn_drive *  input_drive,
struct burn_drive *  output_drive,
int  flag 
)

Revoke isoburn_prepare_*() instead of running isoburn_disc_write().

libisofs reserves resources and maybe already starts generating the image stream when one of above three calls is performed. It is mandatory to either run isoburn_disc_write() or to revoke the preparations by the call described here. If this call returns 0 or 1 then the write thread of libisofs has ended.

Since
0.1.0
Parameters
input_driveThe drive or in_drive which was used with the preparation call.
output_driveThe out_drive used with isoburn_prepare_new_image(), NULL if none.
flagBitfield, submit 0 for now. bit0= -reserved for internal use-
Returns
<0 error, 0= no pending preparations detectable, 1 = canceled

Definition at line 767 of file isoburn.c.

769 {
770  int ret;
771  struct isoburn *o= NULL;
772 
773  if(output_drive!=NULL) {
774  ret= isoburn_find_emulator(&o, output_drive, 0);
775  if(ret<0 || o==NULL)
776  o= NULL;
777  else if(o->iso_source==NULL)
778  o= NULL;
779  }
780  if(o==NULL) {
781  ret= isoburn_find_emulator(&o, d, 0);
782  if(ret<0)
783  return(-1);
784  if(o==NULL)
785  return(0);
786  if(o->iso_source==NULL)
787  return(0);
788  }
789  if(o->iso_source->read!=NULL)
790  return(0);
791  if(o->iso_source->version<1)
792  return(0);
793  o->iso_source->cancel(o->iso_source);
794  burn_source_free(o->iso_source);
795  o->iso_source= NULL;
796  return(1);
797 }
struct burn_source * iso_source
Definition: isoburn.h:154

References isoburn::iso_source, and isoburn_find_emulator().

Referenced by isoburn_sync_after_write(), Xorriso_pacifier_loop(), and Xorriso_write_session().

◆ isoburn_conv_name_chars()

int isoburn_conv_name_chars ( struct isoburn_imgen_opts opts,
char *  name,
size_t  name_len,
char **  result,
size_t *  result_len,
int  flag 
)

Frontend of libisofs call iso_conv_name_chars() controlled by struct isoburn_imgen_opts rather than IsoWriteOpts.

See libisofs.h for a more detailed description.

Since
1.3.6
Parameters
optsDefines options like output charset, UCS-2 versus UTF-16 for Joliet, and naming restrictions.
nameThe input text which shall be converted.
name_lenThe number of bytes in input text.
resultWill return the conversion result in case of success. Terminated by a trailing zero byte. Use free() to dispose it when no longer needed.
result_lenWill return the number of bytes in result (excluding trailing zero)
flagBitfield for control purposes. bit0-bit7= Name space 0= generic (to_charset is valid, no reserved characters, no length limits) 1= Rock Ridge (to_charset is valid) 2= Joliet (to_charset gets overridden by UCS-2 or UTF-16) 3= ECMA-119 (to_charset gets overridden by the dull ISO 9660 subset of ASCII) 4= HFS+ (to_charset gets overridden by UTF-16BE) bit8= Treat input text as directory name (matters for Joliet and ECMA-119) bit9= Do not issue error messages bit15= Reverse operation (best to be done only with results of previous conversions)
Returns
1 means success, <=0 means error

Definition at line 2038 of file isoburn.c.

2041 {
2042  int ret;
2043  IsoWriteOpts *wopts= NULL;
2044 
2045  ret = iso_write_opts_new(&wopts, 0);
2046  if (ret < 0) {
2047  isoburn_report_iso_error(ret, "Cannot create iso_write_opts", 0, "FATAL",0);
2048  goto ex;
2049  }
2050  ret= isoburn_make_iso_write_opts(NULL, opts, 0, wopts, 0);
2051  if(ret < 0)
2052  goto ex;
2053  ret= iso_conv_name_chars(wopts, name, name_len, result, result_len, flag);
2054 ex:;
2055  if(wopts != NULL)
2056  iso_write_opts_free(wopts);
2057  return(ret);
2058 }
int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno, char min_severity[], int flag)
Definition: burn_wrap.c:1221
static int isoburn_make_iso_write_opts(struct isoburn *out_o, struct isoburn_imgen_opts *opts, int fifo_chunks, IsoWriteOpts *wopts, int flag)
Definition: isoburn.c:402

References isoburn_make_iso_write_opts(), and isoburn_report_iso_error().

Referenced by Xorriso_test_outchar().

◆ isoburn_disc_available_space()

off_t isoburn_disc_available_space ( struct burn_drive *  d,
struct burn_write_opts *  o 
)

Return the best possible estimation of the currently available capacity of the medium.

This might depend on particular write option settings and on drive state. An eventual start address for emulated multi-session will be subtracted from the capacity estimation given by burn_disc_available_space(). Negative results get defaulted to 0. Wrapper for: burn_disc_available_space()

Since
0.1.0
Parameters
dThe drive to query.
oIf not NULL: write parameters to be set on drive before query
Returns
number of most probably available free bytes

Definition at line 771 of file burn_wrap.c.

773 {
774  int ret;
775  struct isoburn *o;
776  struct burn_write_opts *eff_opts= NULL, *local_opts= NULL;
777  enum burn_disc_status s;
778  off_t avail;
779 
780  eff_opts= opts;
781  ret= isoburn_find_emulator(&o, d, 0);
782  if(ret>0 && o!=NULL)
783  if(o->emulation_mode!=0) {
785  if(s==BURN_DISC_FULL) /* unknown data format in first 64 kB */
786  return((off_t) 0);
787  local_opts= burn_write_opts_new(d);
788  eff_opts= local_opts;
789  burn_write_opts_set_start_byte(eff_opts, ((off_t) o->nwa) * (off_t) 2048);
790  }
791  avail= burn_disc_available_space(d, eff_opts);
792  if(local_opts!=NULL)
793  burn_write_opts_free(local_opts);
794  local_opts= NULL;
795  return(avail);
796 }
enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive)
Inquire the medium status.
Definition: burn_wrap.c:646
int nwa
Definition: isoburn.h:104

References isoburn::emulation_mode, isoburn_disc_get_status(), isoburn_find_emulator(), and isoburn::nwa.

Referenced by Xorriso_sanitize_image_size(), Xorriso_tell_media_space(), and Xorriso_toc().

◆ isoburn_disc_erasable()

int isoburn_disc_erasable ( struct burn_drive *  d)

Tells whether the medium can be treated by isoburn_disc_erase().

Wrapper for: burn_disc_erasable()

Since
0.1.0
Parameters
dThe drive to inquire.
Returns
0=not erasable , else erasable

Definition at line 682 of file burn_wrap.c.

683 {
684  int ret;
685  struct isoburn *o;
686 
687  ret= isoburn_find_emulator(&o, d, 0);
688  if(ret>0)
689  if(o->emulation_mode==1)
690  return(1);
691  return burn_disc_erasable(d);
692 }

References isoburn::emulation_mode, and isoburn_find_emulator().

Referenced by Xorriso_blank_media().

◆ isoburn_disc_erase()

void isoburn_disc_erase ( struct burn_drive *  drive,
int  fast 
)

Mark the medium as blank.

With multi-session media this will call burn_disc_erase(). With random access media, an eventual ISO-9660 filesystem will get invalidated by altering its start blocks on the medium. In case of success, the medium is in status BURN_DISC_BLANK afterwards. Wrapper for: burn_disc_erase()

Since
0.1.0
Parameters
driveThe drive with the medium to erase.
fast1=fast erase, 0=thorough erase With DVD-RW, fast erase yields media incapable of multi-session.

Definition at line 710 of file burn_wrap.c.

711 {
712  int ret, do_pseudo_blank= 0, role;
713  struct isoburn *o;
714  enum burn_disc_status s;
715  char *zero_buffer= NULL;
716  struct burn_multi_caps *caps= NULL;
717 
718  zero_buffer= calloc(1, Libisoburn_target_head_sizE);
719  if(zero_buffer == NULL) {
720  /* To cause a negative reply with burn_drive_wrote_well() */
721  burn_drive_cancel(drive);
722  goto ex;
723  }
724 
725  ret= isoburn_find_emulator(&o, drive, 0);
726  if(ret>0) {
727  if(o->emulation_mode==-1) {
728  /* To cause a negative reply with burn_drive_wrote_well() */
729  burn_drive_cancel(drive);
730  goto ex;
731  }
732  role = burn_drive_get_drive_role(drive);
733  if (role == 5) {
734  /* libburn will truncate the random-access write-only file
735  to zero size and change its state */
736  burn_disc_erase(drive, fast);
737  o->fabricated_disc_status= burn_disc_get_status(drive);
738  o->nwa= o->zero_nwa= 0;
739  goto ex;
740  }
741  if(o->emulation_mode > 0) { /* might be readonly with emulated sessions */
742  ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0);
743  if(ret <= 0) /* Maybe because of burn_disc_pretend_full() */
744  do_pseudo_blank= isoburn_is_overwritable(drive, 0); /* known profiles */
745  else if(caps->start_adr)
746  do_pseudo_blank= 1;
747  }
748  if(do_pseudo_blank) {
749  s= isoburn_disc_get_status(drive);
750  if(s==BURN_DISC_FULL) { /* unknown data format in first 64 kB */
751  memset(zero_buffer, 0, Libisoburn_target_head_sizE);
752  ret= burn_random_access_write(drive, (off_t) 0, zero_buffer,
753  (off_t) Libisoburn_target_head_sizE, 1);
754  } else {
755  ret= isoburn_invalidate_iso(o, 0);
756  }
757  if(ret<=0)
758  burn_drive_cancel(drive); /* mark run as failure */
759  goto ex;
760  }
761  }
762  burn_disc_erase(drive, fast);
763 ex:;
764  if(caps!=NULL)
765  burn_disc_free_multi_caps(&caps);
766  if(zero_buffer != NULL)
767  free(zero_buffer);
768 }
static int isoburn_is_overwritable(struct burn_drive *drive, int flag)
Definition: burn_wrap.c:695
int isoburn_invalidate_iso(struct isoburn *o, int flag)
Alters and writes the first 64 kB of a "medium" to invalidate an ISO image.
Definition: isofs_wrap.c:673
#define Libisoburn_target_head_sizE
Definition: isoburn.h:51

References isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn_disc_get_status(), isoburn_find_emulator(), isoburn_invalidate_iso(), isoburn_is_overwritable(), Libisoburn_target_head_sizE, isoburn::nwa, and isoburn::zero_nwa.

Referenced by Xorriso_blank_media().

◆ isoburn_disc_get_msc1()

int isoburn_disc_get_msc1 ( struct burn_drive *  d,
int *  start_lba 
)

Obtain the start block number of the most recent session on the medium.

In case of random access media this will normally be 0. Successful return is not a guarantee that there is a ISO-9660 image at all. The call will fail, nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE or BURN_DISC_FULL. Note: The result of this call may be fabricated by a previous call of isoburn_set_msc1() which can override the rule to load the most recent session. Wrapper for: burn_disc_get_msc1()

Since
0.1.0
Parameters
dThe drive to inquire
start_lbaContains on success the start address in 2048 byte blocks
Returns
<=0 error , 1 = success

Definition at line 799 of file burn_wrap.c.

800 {
801  int ret;
802  struct isoburn *o;
803 
804 #ifdef Hardcoded_cd_rW
805  /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
806  *start_lba= Hardcoded_cd_rw_c1;
807  return(1);
808 #endif
809 
810  if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE &&
811  isoburn_disc_get_status(d)!=BURN_DISC_FULL) {
812  isoburn_msgs_submit(NULL, 0x00060000,
813  "Medium contains no recognizable data", 0, "SORRY", 0);
814  return(0);
815  }
816  ret= isoburn_find_emulator(&o, d, 0);
817  if(ret<0)
818  return(0);
819  if(o->fabricated_msc1>=0) {
820  *start_lba= o->fabricated_msc1;
821  return(1);
822  }
823  if(ret>0) if(o->emulation_mode>0) {
824  *start_lba= 0;
825  return(1);
826  }
827  return(burn_disc_get_msc1(d, start_lba));
828 }
int fabricated_msc1
Definition: isoburn.h:85

References isoburn::emulation_mode, isoburn::fabricated_msc1, isoburn_disc_get_status(), isoburn_find_emulator(), and isoburn_msgs_submit().

Referenced by isoburn_read_image(), Xorriso_aquire_drive(), Xorriso_msinfo(), Xorriso_set_system_area(), and Xorriso_update_iso_lba0().

◆ isoburn_disc_get_status()

enum burn_disc_status isoburn_disc_get_status ( struct burn_drive *  drive)

Inquire the medium status.

Expect the whole spectrum of libburn BURN_DISC_* with multi-session media. Emulated states with random access media are BURN_DISC_BLANK and BURN_DISC_APPENDABLE. Wrapper for: burn_disc_get_status()

Since
0.1.0
Parameters
driveThe drive to inquire.
Returns
The status of the drive, or what kind of disc is in it. Note: BURN_DISC_UNGRABBED indicates wrong API usage

Definition at line 627 of file burn_wrap.c.

647 {
648  int ret;
649  struct isoburn *o;
650 
651  ret= isoburn_find_emulator(&o, drive, 0);
652  if(ret<0)
653  return(BURN_DISC_UNSUITABLE);
654  if(o!=NULL)
655  if(o->fabricated_disc_status!=BURN_DISC_UNREADY)
656  return(o->fabricated_disc_status);
657  if(ret==0)
658  return(burn_disc_get_status(drive));
659 
660  /* emulated status */
661  if(o->emulation_mode==-1)
662  return(BURN_DISC_UNSUITABLE);
663  if(o->nwa>o->zero_nwa)
664  return(BURN_DISC_APPENDABLE);
665  return(BURN_DISC_BLANK);
666 }

References isoburn::drive, isoburn_find_by_drive(), and isoburn_msgs_submit().

Referenced by isoburn_disc_available_space(), isoburn_disc_erase(), isoburn_disc_get_msc1(), isoburn_disc_track_lba_nwa(), isoburn_is_intermediate_dvd_rw(), isoburn_needs_emulation(), isoburn_prepare_disc_aux(), isoburn_read_image(), isoburn_set_msc1(), Xorriso_aquire_drive(), Xorriso_blank_as_needed(), Xorriso_blank_media(), Xorriso_burn_track(), Xorriso_check_media(), Xorriso_format_media(), Xorriso_make_write_options(), Xorriso_msinfo(), Xorriso_obtain_indev_readsize(), Xorriso_sanitize_image_size(), Xorriso_set_system_area(), Xorriso_toc(), and Xorriso_write_session().

◆ isoburn_disc_pretend_full_uncond()

int isoburn_disc_pretend_full_uncond ( struct burn_drive *  drive)

Sets the medium status to BURN_DISC_FULL unconditionally.

Since
1.3.8
Parameters
driveThe drive with the medium to be handled as if it was closed. @

Definition at line 669 of file burn_wrap.c.

670 {
671  int ret;
672  struct isoburn *o;
673 
674  ret= isoburn_find_emulator(&o, drive, 0);
675  if(ret > 0 && o != NULL)
676  o->fabricated_disc_status= BURN_DISC_FULL;
677  ret= burn_disc_pretend_full_uncond(drive);
678  return(ret);
679 }

References isoburn::drive, isoburn::fabricated_disc_status, and isoburn_find_emulator().

Referenced by Xorriso_pretend_full_disc().

◆ isoburn_disc_track_lba_nwa()

int isoburn_disc_track_lba_nwa ( struct burn_drive *  d,
struct burn_write_opts *  o,
int  trackno,
int *  lba,
int *  nwa 
)

Use this with trackno==0 to obtain the predicted start block number of the new session.

The interesting number is returned in parameter nwa. Wrapper for: burn_disc_track_lba_nwa()

Since
0.1.0
Parameters
dThe drive to inquire
oIf not NULL: write parameters to be set on drive before query
tracknoSubmit 0.
lbareturn value: start lba
nwareturn value: Next Writeable Address
Returns
1=nwa is valid , 0=nwa is not valid , -1=error

Definition at line 831 of file burn_wrap.c.

834 {
835  int ret;
836  struct isoburn *o;
837  enum burn_disc_status s;
838 
839 #ifdef Hardcoded_cd_rW
840  /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
841  *lba= Hardcoded_cd_rw_c1;
842  *nwa= Hardcoded_cd_rw_nwA;
843  return(1);
844 #endif
845 
846  *nwa= *lba= 0;
847  ret= isoburn_find_emulator(&o, d, 0);
848  if(ret<0)
849  return(0);
850  if(ret>0) if(o->emulation_mode>0) {
851  *lba= 0;
852  *nwa= o->nwa;
853  return(1);
854  }
855  if(burn_drive_get_drive_role(d) != 1)
856  return(1);
857 
859  if(s == BURN_DISC_BLANK) /* We do not believe in anything but nwa = lba = 0 */
860  return(1);
861  return(burn_disc_track_lba_nwa(d, opts, trackno, lba, nwa));
862 }

References isoburn::emulation_mode, isoburn_disc_get_status(), isoburn_find_emulator(), and isoburn::nwa.

Referenced by isoburn_get_msc2(), isoburn_make_iso_write_opts(), Xorriso_burn_track(), Xorriso_msinfo(), Xorriso_sanitize_image_size(), and Xorriso_toc().

◆ isoburn_disc_write()

void isoburn_disc_write ( struct burn_write_opts *  o,
struct burn_disc *  disc 
)

Start writing of the new session.

This call is asynchronous. I.e. it returns quite soon and the progress has to be watched by a loop with call burn_drive_get_status() until BURN_DRIVE_IDLE is returned. Wrapper for: burn_disc_write()

Since
0.1.0
Parameters
oOptions which control the burn process. See burnwrite_opts_*() in libburn.h.
discDisc object created either by isoburn_prepare_disc() or by isoburn_prepare_new_image().

Definition at line 905 of file burn_wrap.c.

906 {
907  int ret;
908  off_t nwa= 0;
909  struct isoburn *o;
910  struct burn_drive *drive;
911  char *reasons= NULL, *msg= NULL, *adr= NULL;
912  struct stat stbuf;
913  enum burn_write_types write_type;
914 
915  drive= burn_write_opts_get_drive(opts);
916 
917  reasons= calloc(1, BURN_REASONS_LEN);
918  msg= calloc(1, 160+BURN_REASONS_LEN);
919  adr= calloc(1, BURN_DRIVE_ADR_LEN);
920  if(reasons == NULL || msg == NULL || adr == NULL) {
921  /* To cause a negative reply with burn_drive_wrote_well() */
922  burn_drive_cancel(drive);
923  goto ex;
924  }
925 
926  ret= isoburn_find_emulator(&o, drive, 0);
927  if(ret<0)
928  goto ex;
929  if(o == NULL) {
930  sprintf(msg,
931  "Program error: Cannot find isoburn object associated to the drive");
932  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
933  burn_drive_cancel(drive);
934  goto ex;
935  }
936  o->wrote_well= -1;
937  if(o->emulation_mode!=0) {
938  burn_write_opts_set_multi(opts, 0);
939  if(o->emulation_mode>0 && o->nwa >= 0) {
940  nwa= o->nwa;
941 
942  /* This caters for unwritten formatted DVD-RW. They need to be written
943  sequentially on the first use. Only written areas are random access.
944  If the first session is not written to LBA 0, then re-opening of
945  formatting and padding is needed.
946  This can be done. But when the track gets closed after padding,
947  this lasts a long time. There is a high risk that an app will not
948  poll the message queue while waiting for isoburn_disc_write() to
949  return. The pacifier loop usually happens only afterwards.
950  So automatic formatting might cause a nervous clueless user.
951  */
952  ret= isoburn_is_intermediate_dvd_rw(drive, 0);
953  if(ret>0 && nwa>0 && nwa <= o->zero_nwa) {
954  /* actually this should not happen since such media get recognized
955  by isoburn_welcome_media and o->zero_nwa gets set to 0
956  */
957  sprintf(msg,
958  "DVD-RW insufficiently formatted. (Intermediate State, size unknown)");
959  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
960  sprintf(msg,
961  "It might help to first deformat it and then format it again");
962  isoburn_msgs_submit(o, 0x00060000, msg, 0, "HINT", 0);
963  burn_drive_cancel(drive); /* mark run as failure */
964  goto ex;
965  }
966  /* end of DVD-RW oriented check */
967  burn_write_opts_set_start_byte(opts, nwa * (off_t) 2048);
968  }
969  }
970 
971  if(o->do_tao) {
972  if (o->do_tao > 0)
973  burn_write_opts_set_write_type(opts, BURN_WRITE_TAO, BURN_BLOCK_MODE1);
974  else
975  burn_write_opts_set_write_type(opts, BURN_WRITE_SAO, BURN_BLOCK_SAO);
976 
977  ret = burn_precheck_write(opts, disc, reasons, 0);
978  if(ret <= 0) {
979  sprintf(msg, "Cannot set write type %s for this medium.",
980  o->do_tao > 0 ? "TAO" : "SAO");
981  sprintf(msg + strlen(msg), "Reasons given:\n %s", reasons);
982  goto no_write_type;
983  }
984  sprintf(msg, "Explicitly chosen write type: %s",
985  o->do_tao > 0 ? "TAO" : "SAO");
986  isoburn_msgs_submit(o, 0x00060000, msg, 0, "NOTE", 0);
987  } else {
988  write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0);
989  if (write_type == BURN_WRITE_NONE) {
990  sprintf(msg, "Failed to find a suitable write type:\n%s", reasons);
991 no_write_type:;
992  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
993  if(o!=NULL)
994  o->wrote_well= 0;
995  /* To cause a negative reply with burn_drive_wrote_well() */
996  burn_drive_cancel(drive);
997  goto ex;
998  }
999 
1000  sprintf(reasons, "%d", (int) write_type);
1001  sprintf(msg, "Write_type = %s\n",
1002  (write_type == BURN_WRITE_SAO ? "SAO" :
1003  (write_type == BURN_WRITE_TAO ? "TAO" : reasons)));
1004  isoburn_msgs_submit(o, 0x00060000, msg, 0, "DEBUG", 0);
1005  }
1006 
1007 #ifdef Hardcoded_cd_rW
1008  /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
1009  fprintf(stderr, "Setting write address to LBA %d\n", Hardcoded_cd_rw_nwA);
1010  burn_write_opts_set_start_byte(opts,
1011  ((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048);
1012 #endif
1013 
1014  if(o->truncate) {
1015  ret= burn_drive_get_drive_role(drive);
1016  if(ret == 2 || ret == 5) {
1017  ret= burn_drive_d_get_adr(drive, adr);
1018  if(ret>0) {
1019  ret= lstat(adr, &stbuf);
1020  if(ret!=-1)
1021  if(S_ISREG(stbuf.st_mode))
1022  ret= truncate(adr, nwa * (off_t) 2048);
1023  /* (result of truncate intentionally ignored) */
1024  }
1025  }
1026  }
1027 
1028  burn_disc_write(opts, disc);
1029 ex:;
1030  if(reasons != NULL)
1031  free(reasons);
1032  if(msg != NULL)
1033  free(msg);
1034  if(adr != NULL)
1035  free(adr);
1036 }
int isoburn_is_intermediate_dvd_rw(struct burn_drive *d, int flag)
Definition: burn_wrap.c:315
int wrote_well
Definition: isoburn.h:129
int truncate
Definition: isoburn.h:108
int do_tao
Definition: isoburn.h:169

References isoburn::do_tao, isoburn::emulation_mode, isoburn_find_emulator(), isoburn_is_intermediate_dvd_rw(), isoburn_msgs_submit(), isoburn::nwa, isoburn::truncate, and isoburn::wrote_well.

Referenced by Xorriso_write_session().

◆ isoburn_drive_aquire()

int isoburn_drive_aquire ( struct burn_drive_info *  drive_infos[],
char *  adr,
int  flag 
)

Acquire a target drive by its filesystem path or libburn persistent address.

This is a modern successor of isoburn_drive_scan_and_grab().
Wrapper for: burn_drive_scan_and_grab()

Since
0.1.2
Parameters
drive_infosOn success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when the drive is no longer needed. But before this is done one has to call isoburn_drive_release(drive_infos[0].drive).
adrThe persistent address of the desired drive or the path to a file object.
flagbit0= attempt to load the disc tray. Else: failure if not loaded. bit1= regard overwritable media as blank bit2= if the drive is a regular disk file: truncate it to the write start address when writing begins bit3= if the drive reports a read-only profile try to read table of content by scanning for ISO image headers. (depending on media type and drive this might help or it might make the resulting toc even worse) bit4= do not emulate table of content on overwritable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems (xattr) bit7= pretend read-only profile and scan for table of content bit8= re-assess already acquired (*drive_infos)[0] rather than acquiring adr
Since
1.1.8 bit9= when scanning for ISO 9660 sessions by bit3: Do not demand a valid superblock at LBA 0, ignore it in favor of one at LBA 32, and scan until end of medium.
1.2.6 bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.".
1.5.0
Returns
1 = success , 0 = drive not found , <0 = other error

Please excuse the typo "aquire" in the function name.

Parameters
flagbit0= load bit1= regard overwritable media as blank bit2= if the drive is a regular disk file: truncate it to the write start address bit3= if the drive reports a -ROM profile then try to read table of content by scanning for ISO image headers. (depending on media type and drive state this might help or it might make the resulting toc even worse) bit4= do not emulate TOC on overwritable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems bit7= pretend -ROM profile and scan for table of content bit8= re-assess (*drive_infos)[0] rather than acquiring adr bit9= when scanning for ISO 9660 sessions on overwritable media: Do not demand a valid superblock at LBA 0 and scan until end of medium. bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.".

Definition at line 545 of file burn_wrap.c.

547 {
548  int ret, drive_grabbed= 0;
549  struct isoburn *o= NULL;
550  int conv_ret;
551  char *libburn_drive_adr= NULL;
552 
553  /* Should be obsolete by new drive addressing of libburn-0.5.2 */
554  /* but helps with kernel 2.4 to use /dev/sr */
555  libburn_drive_adr= calloc(1, BURN_DRIVE_ADR_LEN);
556  if(libburn_drive_adr == NULL)
557  {ret= -1; goto ex;}
558  conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr);
559  if(conv_ret<=0)
560  strcpy(libburn_drive_adr, adr);
561 
562  if(flag & 256)
563  ret= burn_drive_re_assess((*drive_infos)[0].drive, 0);
564  else
565  ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1);
566  if(ret<=0)
567  goto ex;
568  drive_grabbed= 1;
569  ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive,
570  (flag & (8 | 16 | 32 | 64 | 128 | 512 | 1024)) |
571  !!(flag&2));
572  if(ret<=0)
573  goto ex;
574 
575  if(flag&4) {
576  ret= isoburn_find_emulator(&o, (*drive_infos)[0].drive, 0);
577  if(ret>0 && o!=NULL)
578  o->truncate= 1;
579  }
580 
581  ret= 1;
582 ex:
583  if(ret<=0) {
584  if(drive_grabbed)
585  burn_drive_release((*drive_infos)[0].drive, 0);
586  isoburn_destroy(&o, 0);
587  }
588  if(libburn_drive_adr != NULL)
589  free(libburn_drive_adr);
590  return(ret);
591 }
static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d, int flag)
Examines the medium and sets appropriate emulation if needed.
Definition: burn_wrap.c:349
int isoburn_destroy(struct isoburn **objpt, int flag)
Definition: isoburn.c:178

References isoburn::drive, isoburn_destroy(), isoburn_find_emulator(), isoburn_welcome_media(), and isoburn::truncate.

Referenced by isoburn_drive_scan_and_grab(), Xorriso_aquire_drive(), and Xorriso_mount().

◆ isoburn_drive_grab()

int isoburn_drive_grab ( struct burn_drive *  drive,
int  load 
)

Acquire a drive from the burn_drive_info[] array which was obtained by a previous call of burn_drive_scan().

Wrapper for: burn_drive_grab()

Since
0.1.0
Parameters
driveThe drive to grab. E.g. drive_infos[1].drive . Call isoburn_drive_release(drive) when it it no longer needed.
load1 attempt to load the disc tray. 0 no attempt, rather failure.
Returns
1 success, <=0 failure

Definition at line 604 of file burn_wrap.c.

605 {
606  int ret;
607  struct isoburn *o= NULL;
608 
609  ret= burn_drive_grab(drive, load);
610  if(ret<=0)
611  goto ex;
612  ret= isoburn_welcome_media(&o, drive, 0);
613  if(ret<=0)
614  goto ex;
615 
616  ret= 1;
617 ex:
618  if(ret<=0)
619  isoburn_destroy(&o,0);
620  return(ret);
621 }

References isoburn::drive, isoburn_destroy(), and isoburn_welcome_media().

◆ isoburn_drive_release()

void isoburn_drive_release ( struct burn_drive *  drive,
int  eject 
)

Release an acquired drive.

Wrapper for: burn_drive_release()

Since
0.1.0
Parameters
driveThe drive to be released
eject1= eject medium from drive , 0= do not eject

Definition at line 1039 of file burn_wrap.c.

1040 {
1041  int ret;
1042  struct isoburn *o;
1043 
1044  ret= isoburn_find_emulator(&o, drive, 0);
1045  if(ret<0)
1046  return;
1047  if(o!=NULL) {
1048  isoburn_destroy(&o, 0);
1049  }
1050  burn_drive_release(drive, eject);
1051 }

References isoburn::drive, isoburn_destroy(), and isoburn_find_emulator().

Referenced by Xorriso_give_up_drive(), and Xorriso_mount().

◆ isoburn_drive_scan_and_grab()

int isoburn_drive_scan_and_grab ( struct burn_drive_info *  drive_infos[],
char *  adr,
int  load 
)

Acquire a target drive by its filesystem path or libburn persistent address.

Wrapper for: burn_drive_scan_and_grab()

Since
0.1.0
Parameters
drive_infosOn success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when the drive is no longer needed. But before this is done one has to call isoburn_drive_release(drive_infos[0].drive).
adrThe persistent address of the desired drive or the path to a file object.
load1 attempt to load the disc tray. 0 no attempt,rather failure.
Returns
1 = success , 0 = drive not found , <0 = other error

Definition at line 594 of file burn_wrap.c.

596 {
597  int ret;
598 
599  ret= isoburn_drive_aquire(drive_infos, adr, !!load);
600  return(ret);
601 }
int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], char *adr, int flag)
Acquire a target drive by its filesystem path or libburn persistent address.
Definition: burn_wrap.c:545

References isoburn_drive_aquire().

◆ isoburn_drive_set_msgs_submit()

int isoburn_drive_set_msgs_submit ( struct burn_drive *  d,
int(*)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)  msgs_submit,
void *  submit_handle,
int  submit_flag,
int  flag 
)

Attach to a drive an application provided method for immediate delivery of messages.

If no method is set or if the method is set to NULL then libisoburn delivers messages of the drive through the global msgs_submit() method set by isoburn_set_msgs_submiti() or by the message queue of libburn.

Since
0.2.0
Parameters
dThe drive to which this function, handle and flag shall apply
msgs_submitThe function call which implements the method
submit_handleHandle to be used as first argument of msgs_submit
submit_flagFlag to be used as last argument of msgs_submit
flagUnused yet, submit 0

Definition at line 1915 of file burn_wrap.c.

1920 {
1921  struct isoburn *o;
1922  int ret;
1923 
1924  ret= isoburn_find_emulator(&o, d, 0);
1925  if(ret<0 || o==NULL)
1926  return(-1);
1928  o->msgs_submit_handle= submit_handle;
1929  o->msgs_submit_flag= submit_flag;
1930  return(1);
1931 }
int(* msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)
Definition: isoburn.h:163
int msgs_submit_flag
Definition: isoburn.h:166
void * msgs_submit_handle
Definition: isoburn.h:165

References isoburn_find_emulator(), isoburn::msgs_submit, isoburn::msgs_submit_flag, and isoburn::msgs_submit_handle.

◆ isoburn_drive_wrote_well()

int isoburn_drive_wrote_well ( struct burn_drive *  d)

Inquire whether the most recent write run was successful.

Wrapper for: burn_drive_wrote_well()

Since
0.1.0
Parameters
dThe drive to inquire
Returns
1=burn seems to have went well, 0=burn failed

Definition at line 1132 of file burn_wrap.c.

1133 {
1134  int ret;
1135  struct isoburn *o;
1136 
1137  ret= isoburn_find_emulator(&o, d, 0);
1138  if(ret<0)
1139  return(-1);
1140  if(o!=NULL)
1141  if(o->wrote_well>=0)
1142  return(o->wrote_well);
1143  ret= burn_drive_wrote_well(d);
1144  return ret;
1145 }

References isoburn_find_emulator(), and isoburn::wrote_well.

Referenced by Xorriso_write_session().

◆ isoburn_finish()

void isoburn_finish ( void  )

Shutdown all three libraries.

Wrapper for : iso_finish() and burn_finish().

Since
0.1.0

Definition at line 1054 of file burn_wrap.c.

1055 {
1057  burn_finish();
1058  iso_finish();
1059 }
struct isoburn * isoburn_list_start
Definition: isoburn.c:112
int isoburn_destroy_all(struct isoburn **objpt, int flag)
Definition: isoburn.c:213

References isoburn_destroy_all(), and isoburn_list_start.

Referenced by Xorriso_detach_libraries().

◆ isoburn_get_attached_image()

IsoImage* isoburn_get_attached_image ( struct burn_drive *  d)

Get the image attached to a drive, if any.

Since
0.1.0
Parameters
dThe drive to inquire
Returns
A reference to attached image, or NULL if the drive has no image attached. This reference needs to be released via iso_image_unref() when it is not longer needed.

Definition at line 92 of file isofs_wrap.c.

93 {
94  int ret;
95  struct isoburn *o= NULL;
96  ret = isoburn_find_emulator(&o, d, 0);
97  if (ret < 0)
98  return NULL;
99 
100  if (o == NULL) {
101  return NULL;
102  }
103  iso_image_ref(o->image);
104  return o->image;
105 }

References isoburn::image, and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive(), Xorriso_attach_boot_image(), Xorriso_boot_image_status(), Xorriso_pacifier_loop(), Xorriso_record_boot_info(), Xorriso_set_system_area_path(), Xorriso_show_boot_info(), and Xorriso_write_session().

◆ isoburn_get_attached_start_lba()

int isoburn_get_attached_start_lba ( struct burn_drive *  d)

Get the start address of the image that is attached to the drive, if any.

Since
1.2.2
Parameters
dThe drive to inquire
Returns
The logical block address where the System Area of the image starts. <0 means that the address is invalid.

Definition at line 109 of file isofs_wrap.c.

110 {
111  int ret;
112  struct isoburn *o= NULL;
113 
114  ret = isoburn_find_emulator(&o, d, 0);
115  if (ret < 0 || o == NULL)
116  return -1;
117  if(o->image == NULL)
118  return -1;
119  return o->image_start_lba;
120 }

References isoburn::image, isoburn::image_start_lba, and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive(), and Xorriso_check_media().

◆ isoburn_get_fifo_status()

int isoburn_get_fifo_status ( struct burn_drive *  d,
int *  size,
int *  free_bytes,
char **  status_text 
)

Inquire state and fill parameters of the fifo which is attached to the emerging track.

This should be done in the pacifier loop while isoburn_disc_write() or burn_disc_write() are active. This works only with drives obtained by isoburn_drive_scan_and_grab() or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then parameter out_drive must have announced the track output drive. Hint: If only burn_write_opts and not burn_drive is known, then the drive can be obtained by burn_write_opts_get_drive().

Since
0.1.0
Parameters
dThe drive to which the track with the fifo gets burned.
sizeThe total size of the fifo
free_bytesThe current free capacity of the fifo
status_textReturns a pointer to a constant text, see below
Returns
<0 reply invalid, >=0 fifo status code: bit0+1=input status, bit2=consumption status, i.e: 0="standby" : data processing not started yet 1="active" : input and consumption are active 2="ending" : input has ended without error 3="failing" : input had error and ended, 4="unused" : ( consumption has ended before processing start ) 5="abandoned" : consumption has ended prematurely 6="ended" : consumption has ended without input error 7="aborted" : consumption has ended after input error

Definition at line 1148 of file burn_wrap.c.

1150 {
1151  int ret;
1152  struct isoburn *o;
1153  size_t hsize= 0, hfree_bytes= 0;
1154 
1155  ret= isoburn_find_emulator(&o, d, 0);
1156  if(ret<0)
1157  return(-1);
1158 
1159  if(o==NULL)
1160  return(-1);
1161  if(o->iso_source==NULL)
1162  return(-1);
1163  ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes);
1164  if(hsize > 1024*1024*1024)
1165  *size= 1024*1024*1024;
1166  else
1167  *size= hsize;
1168  if(hfree_bytes > 1024*1024*1024)
1169  *free_bytes= 1024*1024*1024;
1170  else
1171  *free_bytes= hfree_bytes;
1172  *status_text= "";
1173  if(ret==0)
1174  *status_text= "standby";
1175  else if(ret==1)
1176  *status_text= "active";
1177  else if(ret==2)
1178  *status_text= "ending";
1179  else if(ret==3)
1180  *status_text= "failing";
1181  else if(ret==4)
1182  *status_text= "unused";
1183  else if(ret==5)
1184  *status_text= "abandoned";
1185  else if(ret==6)
1186  *status_text= "ended";
1187  else if(ret==7)
1188  *status_text= "aborted";
1189  return(ret);
1190 }

References isoburn::iso_source, and isoburn_find_emulator().

Referenced by Xorriso_pacifier_loop().

◆ isoburn_get_img_partition_offset()

int isoburn_get_img_partition_offset ( struct burn_drive *  drive,
uint32_t *  block_offset_2k 
)

Inquire the partition offset of the loaded image.

The first 512 bytes of the image get examined whether they bear an MBR signature and a first partition table entry which matches the size of the image. In this case the start address is recorded as partition offset and internal buffers get adjusted. See also isoburn_igopt_set_part_offset().

Since
0.6.2
Parameters
driveThe drive with the loaded image
block_offset_2kreturns the recognized partition offset
Returns
<0 = error 0 = no partition offset recognized 1 = acceptable non-zero offset, buffers are adjusted 2 = offset is credible but not acceptable for buffer size

Inquire the partition offset of the loaded image.

Since
0.6.2

Definition at line 424 of file isofs_wrap.c.

426 {
427  int ret;
428  struct isoburn *o;
429 
430  ret = isoburn_find_emulator(&o, drive, 0);
431  if(ret < 0 || o == NULL)
432  return -1;
433  *block_offset_2k= o->loaded_partition_offset;
434  if(o->loaded_partition_offset == 0)
435  return(0);
437  + (off_t) 2048 * (off_t) o->loaded_partition_offset)
438  return(1);
439  return(2);
440 }
uint32_t loaded_partition_offset
Definition: isoburn.h:138

References isoburn::drive, isoburn_find_emulator(), Libisoburn_target_head_sizE, isoburn::loaded_partition_offset, and isoburn::target_iso_head_size.

Referenced by Xorriso_aquire_drive(), and Xorriso_set_system_area().

◆ isoburn_get_min_start_byte()

int isoburn_get_min_start_byte ( struct burn_drive *  d,
off_t *  start_byte,
int  flag 
)

Obtain the size which was attributed to an emulated appendable on actually overwritable media.

This value is supposed to be <= 2048 * nwa as of isoburn_disc_track_lba_nwa().

Since
0.1.0
Parameters
dThe drive holding the medium.
start_byteThe reply value counted in bytes, not in sectors.
flagUnused yet. Submit 0.
Returns
1=stat_byte is valid, 0=not an emulated appendable, -1=error

Definition at line 1114 of file burn_wrap.c.

1116 {
1117  int ret;
1118  struct isoburn *o;
1119 
1120  ret= isoburn_find_emulator(&o, d, 0);
1121  if(ret<0)
1122  return(-1);
1123  if(ret==0)
1124  return(0);
1125  *start_byte= o->min_start_byte;
1126  if(o->min_start_byte<=0)
1127  return(0);
1128  return(1);
1129 }
off_t min_start_byte
Definition: isoburn.h:101

References isoburn_find_emulator(), and isoburn::min_start_byte.

Referenced by Xorriso_toc().

◆ isoburn_get_mount_params()

int isoburn_get_mount_params ( struct burn_drive *  d,
int  adr_mode,
char *  adr_value,
int *  lba,
int *  track,
int *  session,
char  volid[33],
int  flag 
)

Try to convert the given entity address into various entity addresses which would describe it.

Note: Sessions and tracks are counted beginning with 1, not with 0.

Since
0.3.2
Parameters
dThe drive where msc1 is to be set
adr_modeDetermines how to interpret the input adr_value. If adr_value shall represent a number then decimal ASCII digits are expected. 0= start lba of last session in TOC, ignore adr_value 1= start lba of session number given by adr_value 2= start lba of track given number by adr_value 3= adr_value itself is the lba to be used 4= start lba of last session with volume id given by adr_value
adr_valueA string describing the value to be eventually used.
lbareturns the block address of the entity, -1 means invalid
trackreturns the track number of the entity, -1 means invalid
sessionreturns the session number of the entity, -1 means invalid
volidreturns the volume id of the entity if it is a ISO session
flagBitfield for control purposes. bit2= with adr_mode 4: use adr_value as regular expression
Returns
<=0 error , 1 ok, ISO session, 2 ok, not an ISO session

Definition at line 2105 of file burn_wrap.c.

2109 {
2110  int msc1_mem, ret, total_tracks, num_sessions, num_tracks, i, j, track_lba;
2111  int size, is_iso= 0;
2112  struct isoburn *o;
2113  struct isoburn_toc_disc *disc= NULL;
2114  struct isoburn_toc_session **sessions= NULL;
2115  struct isoburn_toc_track **tracks= NULL;
2116 
2117  *lba= *track= *session= -1;
2118  volid[0]= 0;
2119  ret= isoburn_find_emulator(&o, d, 0);
2120  if(ret < 0 || o == NULL)
2121  return(-1);
2122  msc1_mem= o->fabricated_msc1;
2123  ret= isoburn_set_msc1(d, adr_mode, adr_value, 2 | (flag & 4));
2124  if(ret <= 0)
2125  return(ret);
2126  *lba= o->fabricated_msc1;
2127 
2128  disc= isoburn_toc_drive_get_disc(d);
2129  if(disc==NULL)
2130  {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */
2131  sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions);
2132  if(sessions==NULL || num_sessions<=0)
2133  {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */
2134  total_tracks= 0;
2135  for(i=0; i<num_sessions && *session < 0; i++) {
2136  tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks);
2137  if(tracks==NULL)
2138  continue;
2139  for(j= 0; j<num_tracks && *track < 0; j++) {
2140  total_tracks++;
2141  isoburn_get_track_lba(tracks[j], &track_lba, 0);
2142  if(track_lba == *lba) {
2143  *track= total_tracks;
2144  *session= i + 1;
2145  }
2146  }
2147  }
2148  ret= isoburn_read_iso_head(d, *lba, &size, volid, 1);
2149  if(ret <= 0)
2150  volid[0]= 0;
2151  else
2152  is_iso= 1;
2153 
2154 ex:;
2155  o->fabricated_msc1= msc1_mem;
2156  if(disc != NULL)
2157  isoburn_toc_disc_free(disc);
2158  return(2 - is_iso);
2159 }
struct isoburn_toc_session ** isoburn_toc_disc_get_sessions(struct isoburn_toc_disc *disc, int *num)
Get the array of session handles and the number of complete sessions from the table of content.
Definition: burn_wrap.c:1774
struct isoburn_toc_track ** isoburn_toc_session_get_tracks(struct isoburn_toc_session *s, int *num)
Get the array of track handles from a particular session.
Definition: burn_wrap.c:1852
int isoburn_get_track_lba(struct isoburn_toc_track *track, int *lba, int flag)
Definition: burn_wrap.c:1902
int isoburn_read_iso_head(struct burn_drive *d, int lba, int *image_blocks, char *info, int flag)
Try whether the data at the given address look like a ISO 9660 image header and obtain its alleged si...
Definition: burn_wrap.c:1301
void isoburn_toc_disc_free(struct isoburn_toc_disc *d)
Release the memory associated with a master handle of a medium.
Definition: burn_wrap.c:1893
struct isoburn_toc_disc * isoburn_toc_drive_get_disc(struct burn_drive *d)
Obtain a master handle for the table of content.
Definition: burn_wrap.c:1631
int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int flag)
Set up isoburn_disc_get_msc1() to return a fabricated value.
Definition: burn_wrap.c:1938
struct burn_disc * disc
Definition: isoburn.h:833
struct burn_track * track
Definition: isoburn.h:819

References isoburn_toc_disc::disc, isoburn::fabricated_msc1, isoburn_find_emulator(), isoburn_get_track_lba(), isoburn_read_iso_head(), isoburn_set_msc1(), isoburn_toc_disc_free(), isoburn_toc_disc_get_sessions(), isoburn_toc_drive_get_disc(), isoburn_toc_session_get_tracks(), and isoburn_toc_track::track.

Referenced by Xorriso_aquire_drive(), Xorriso_mount(), and Xorriso_truncate_overwritable().

◆ isoburn_igopt_attach_jte()

int isoburn_igopt_attach_jte ( struct isoburn_imgen_opts opts,
void *  libjte_handle 
)

Associate a libjte environment object to the upcoming write run.

libjte implements Jigdo Template Extraction as of Steve McIntyre and Richard Atterer. A non-NULL libjte_handle will cause failure to write if libjte was not enabled in libisofs at compile time.

Since
0.6.4
Parameters
optsThe option set to work on
libjte_handlePointer to a struct libjte_env e.g. created by libjte_new(). It must stay existent from the start of image writing by isoburn_prepare_*() until the write thread has ended. E.g. until libburn indicates the end of its write run.
Returns
1 success, <=0 failure

Definition at line 1621 of file isoburn.c.

1623 {
1624  opts->libjte_handle = libjte_handle;
1625  return 1;
1626 }
void * libjte_handle
Definition: isoburn.h:691

References isoburn_imgen_opts::libjte_handle.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_destroy()

int isoburn_igopt_destroy ( struct isoburn_imgen_opts **  o,
int  flag 
)

Deletes an option set which was created by isoburn_igopt_new().

Since
0.1.0
Parameters
oThe option set to give up
flagBitfield for control purposes. Submit 0 for now.
Returns
1= **o destroyed , 0= *o was already NULL (harmless)

Definition at line 1216 of file isoburn.c.

1217 {
1218  int i;
1219 
1220  if(*o==NULL)
1221  return(0);
1222  if((*o)->rr_reloc_dir != NULL)
1223  free((*o)->rr_reloc_dir);
1224  if((*o)->prep_partition != NULL)
1225  free((*o)->prep_partition);
1226  if((*o)->efi_boot_partition != NULL)
1227  free((*o)->efi_boot_partition);
1228  for(i= 0; i < Libisoburn_max_appended_partitionS; i++)
1229  if((*o)->appended_partitions[i] != NULL)
1230  free((*o)->appended_partitions[i]);
1231  if ((*o)->system_area_data != NULL)
1232  free((*o)->system_area_data);
1233  free(*o);
1234  *o= NULL;
1235  return(1);
1236 }
#define Libisoburn_max_appended_partitionS
Definition: isoburn.h:57

References Libisoburn_max_appended_partitionS.

Referenced by Xorriso_relax_compliance(), Xorriso_test_outchar(), and Xorriso_write_session().

◆ isoburn_igopt_detach_jte()

int isoburn_igopt_detach_jte ( struct isoburn_imgen_opts opts,
void **  libjte_handle 
)

Remove eventual association to a libjte environment handle.

Since
0.6.4
Parameters
optsThe option set to work on
libjte_handleIf not submitted as NULL, this will return the previously set libjte handle.
Returns
1 success, <=0 failure

Definition at line 1629 of file isoburn.c.

1631 {
1632  if(libjte_handle != NULL)
1633  *libjte_handle = opts->libjte_handle;
1634  opts->libjte_handle = NULL;
1635  return 1;
1636 }

References isoburn_imgen_opts::libjte_handle.

◆ isoburn_igopt_get_appended_as_apm()

int isoburn_igopt_get_appended_as_apm ( struct isoburn_imgen_opts opts,
int *  apm 
)

Inquire the current setting made by isoburn_igopt_set_appended_as_apm().

Since
1.4.4
Parameters
optsThe option set to be inquired.
apmReturns the current value.
Returns
<=0 = error, 1 = success

Definition at line 1854 of file isoburn.c.

1856 {
1857  *apm= opts->appended_as_apm;
1858  return(1);
1859 }

References isoburn_imgen_opts::appended_as_apm.

◆ isoburn_igopt_get_appended_as_gpt()

int isoburn_igopt_get_appended_as_gpt ( struct isoburn_imgen_opts opts,
int *  gpt 
)

Inquire the current setting made by isoburn_igopt_set_appended_as_gpt().

Since
1.4.0
Parameters
optsThe option set to be inquired.
gptReturns the current value.
Returns
<=0 = error, 1 = success

Definition at line 1797 of file isoburn.c.

1799 {
1800  *gpt= opts->appended_as_gpt;
1801  return(1);
1802 }

References isoburn_imgen_opts::appended_as_gpt.

◆ isoburn_igopt_get_data_start()

int isoburn_igopt_get_data_start ( struct isoburn_imgen_opts o,
int *  lba 
)

Obtain after image preparation the lowest block address of file content data.

Failure can occur if libisofs is too old to provide this information, if the result exceeds 31 bit, or if the call is made before image preparation. This value cannot be set by the application but only be inquired.

Since
0.3.6
Parameters
oThe option set to work on
lbaThe block number of the session start on the medium. <0 means that no address has been determined yet.
Returns
1 success, <=0 failure

Definition at line 1503 of file isoburn.c.

1504 {
1505  *lba= o->data_start_lba;
1506  return(1);
1507 }
int data_start_lba
Output value: Block address of data section start as predicted by libisofs.
Definition: isoburn.h:639

References isoburn_imgen_opts::data_start_lba.

Referenced by Xorriso_write_session().

◆ isoburn_igopt_get_disc_label()

int isoburn_igopt_get_disc_label ( struct isoburn_imgen_opts opts,
char **  label 
)

Inquire the current setting made by isoburn_igopt_set_disc_label().

Since
0.6.6
Parameters
optsThe option set to be inquired.
labelReturns a pointer to the currently set label string. Do not alter this string. Use only as long as the opts object exists.
Returns
<=0 = error, 1 = success

Definition at line 1948 of file isoburn.c.

1949 {
1950  *label= opts->ascii_disc_label;
1951  return(1);
1952 }
char ascii_disc_label[129]
Definition: isoburn.h:747

References isoburn_imgen_opts::ascii_disc_label.

◆ isoburn_igopt_get_effective_lba()

int isoburn_igopt_get_effective_lba ( struct isoburn_imgen_opts o,
int *  lba 
)

Obtain after image preparation the block address where the session will start on the medium.

This value cannot be set by the application but only be inquired.

Since
0.1.4
Parameters
oThe option set to work on
lbaThe block number of the session start on the medium. <0 means that no address has been determined yet.
Returns
1 success, <=0 failure

Definition at line 1496 of file isoburn.c.

1497 {
1498  *lba= o->effective_lba;
1499  return(1);
1500 }
int effective_lba
Output value: Block address of session start as evaluated from medium and other options by libisoburn...
Definition: isoburn.h:632

References isoburn_imgen_opts::effective_lba.

Referenced by Xorriso_write_session().

◆ isoburn_igopt_get_efi_bootp()

int isoburn_igopt_get_efi_bootp ( struct isoburn_imgen_opts opts,
char **  path,
int  flag 
)

Definition at line 1702 of file isoburn.c.

1704 {
1705  *path= opts->efi_boot_partition;
1706  if(flag & 1)
1707  return(1 + (opts->efi_boot_part_flag & 0x3fffffff));
1708  return(1);
1709 }
int efi_boot_part_flag
Definition: isoburn.h:701
char * efi_boot_partition
Definition: isoburn.h:700

References isoburn_imgen_opts::efi_boot_part_flag, and isoburn_imgen_opts::efi_boot_partition.

◆ isoburn_igopt_get_extensions()

int isoburn_igopt_get_extensions ( struct isoburn_imgen_opts o,
int *  ext 
)

Definition at line 1271 of file isoburn.c.

1272 {
1273  *ext= (!!o->rockridge) | ((!!o->joliet)<<1) | ((!!o->iso1999)<<2) |
1274  ((!!o->hardlinks) << 3) | ((!!o->aaip) << 5) |
1275  ((!!o->session_md5) << 6) | ((o->file_md5 & 3) << 7) |
1276  ((!!o->no_emul_toc) << 9) | ((o->will_cancel) << 10) |
1277  ((!!o->old_empty) << 11) | ((!!o->hfsplus) << 12) |
1278  ((!!o->fat) << 13);
1279  return(1);
1280 }
unsigned int fat
Definition: isoburn.h:422
unsigned int hfsplus
Definition: isoburn.h:421
unsigned int no_emul_toc
Definition: isoburn.h:441
unsigned int aaip
Definition: isoburn.h:428
unsigned int session_md5
Definition: isoburn.h:431
unsigned int joliet
Definition: isoburn.h:419
unsigned int old_empty
Definition: isoburn.h:447
unsigned int iso1999
Definition: isoburn.h:420
unsigned int file_md5
Definition: isoburn.h:436
unsigned int rockridge
Which extensions to support.
Definition: isoburn.h:418
unsigned int hardlinks
Definition: isoburn.h:425

References isoburn_imgen_opts::aaip, isoburn_imgen_opts::fat, isoburn_imgen_opts::file_md5, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::hfsplus, isoburn_imgen_opts::iso1999, isoburn_imgen_opts::joliet, isoburn_imgen_opts::no_emul_toc, isoburn_imgen_opts::old_empty, isoburn_imgen_opts::rockridge, isoburn_imgen_opts::session_md5, and isoburn_imgen_opts::will_cancel.

◆ isoburn_igopt_get_fifo_size()

int isoburn_igopt_get_fifo_size ( struct isoburn_imgen_opts o,
int *  fifo_size 
)

Definition at line 1489 of file isoburn.c.

1490 {
1491  *fifo_size= o->fifo_size;
1492  return(1);
1493 }
int fifo_size
The number of bytes to be used for the fifo which decouples libisofs and libburn for better throughpu...
Definition: isoburn.h:624

References isoburn_imgen_opts::fifo_size.

◆ isoburn_igopt_get_gpt_guid()

int isoburn_igopt_get_gpt_guid ( struct isoburn_imgen_opts opts,
uint8_t  guid[16],
int *  mode 
)

Inquire the current setting of isoburn_igopt_set_gpt_guid().

Since
1.4.6
Parameters
optsThe option set to be inquired.
guidReturns the current guid if current mode is 1.
modeReturns the current value.
Returns
<=0 = error, 1 = success

Definition at line 1930 of file isoburn.c.

1932 {
1933  if(opts->gpt_guid_mode == 1)
1934  memcpy(guid, opts->gpt_guid, 16);
1935  *mode = opts->gpt_guid_mode;
1936  return(1);
1937 }
uint8_t gpt_guid[16]
Definition: isoburn.h:742

References isoburn_imgen_opts::gpt_guid, and isoburn_imgen_opts::gpt_guid_mode.

◆ isoburn_igopt_get_hfsp_block_size()

int isoburn_igopt_get_hfsp_block_size ( struct isoburn_imgen_opts opts,
int *  hfsp_block_size,
int *  apm_block_size 
)

Inquire the current setting made by isoburn_igopt_set_hfsp_block_size.

Since
1.2.4
Parameters
optsThe option set to be inquired.
hfsp_block_sizeWill be set to a value as described above. Except -1.
apm_block_sizeWill be set to a value as described above. Except -1.
Returns
<=0 = error, 1 = success

Definition at line 2000 of file isoburn.c.

2002 {
2003  *hfsp_block_size= opts->hfsp_block_size;
2004  *apm_block_size= opts->apm_block_size;
2005  return(1);
2006 }

References isoburn_imgen_opts::apm_block_size, and isoburn_imgen_opts::hfsp_block_size.

◆ isoburn_igopt_get_hfsp_serial_number()

int isoburn_igopt_get_hfsp_serial_number ( struct isoburn_imgen_opts opts,
uint8_t  serial_number[8] 
)

Inquire the current setting made by isoburn_igopt_set_disc_label()

Since
1.2.4
Parameters
optsThe option set to be inquired.
serial_numberWill get filled with the current setting.
Returns
<=0 = error, 1 = success

Definition at line 1963 of file isoburn.c.

1965 {
1966  memcpy(serial_number, opts->hfsp_serial_number, 8);
1967  return(1);
1968 }
uint8_t hfsp_serial_number[8]
Definition: isoburn.h:752

References isoburn_imgen_opts::hfsp_serial_number.

◆ isoburn_igopt_get_iso_mbr_part_type()

int isoburn_igopt_get_iso_mbr_part_type ( struct isoburn_imgen_opts opts,
int *  part_type 
)

Inquire the current setting of isoburn_igopt_set_iso_mbr_part_type().

Since
1.4.8
Parameters
optsThe option set to be inquired.
part_typeReturns the current value: -1, 0x00 to 0xff.
Returns
<=0 = error, 1 = success

Definition at line 1888 of file isoburn.c.

1890 {
1891  *part_type= opts->iso_mbr_part_type;
1892  return(1);
1893 }

References isoburn_imgen_opts::iso_mbr_part_type.

◆ isoburn_igopt_get_iso_type_guid()

int isoburn_igopt_get_iso_type_guid ( struct isoburn_imgen_opts opts,
uint8_t  guid[16] 
)

Inquire the current setting of isoburn_igopt_set_iso_type_guid().

Since
1.5.2
Parameters
optsThe option set to be inquired.
guidGets filled with the 16 bytes of GUID.
Returns
<= error, 0= guid is invalid, 1 = guid is valid

Definition at line 1906 of file isoburn.c.

1908 {
1909  memcpy(guid, opts->iso_gpt_type_guid, 16);
1910  return(opts->iso_gpt_flag & 1);
1911 }
uint8_t iso_gpt_type_guid[16]
Definition: isoburn.h:735

References isoburn_imgen_opts::iso_gpt_flag, and isoburn_imgen_opts::iso_gpt_type_guid.

◆ isoburn_igopt_get_level()

int isoburn_igopt_get_level ( struct isoburn_imgen_opts o,
int *  level 
)

Definition at line 1246 of file isoburn.c.

1247 {
1248  *level= o->level;
1249  return(1);
1250 }
int level
ISO level to write at.
Definition: isoburn.h:415

References isoburn_imgen_opts::level.

◆ isoburn_igopt_get_out_charset()

int isoburn_igopt_get_out_charset ( struct isoburn_imgen_opts o,
char **  output_charset 
)

Definition at line 1474 of file isoburn.c.

1476 {
1477  *output_charset= o->output_charset;
1478  return(1);
1479 }
char * output_charset
gid to use when replace_gid == 2.
Definition: isoburn.h:612

References isoburn_imgen_opts::output_charset.

◆ isoburn_igopt_get_over_mode()

int isoburn_igopt_get_over_mode ( struct isoburn_imgen_opts o,
int *  replace_dir_mode,
int *  replace_file_mode,
mode_t *  dir_mode,
mode_t *  file_mode 
)

Definition at line 1431 of file isoburn.c.

1434 {
1435  *replace_dir_mode= o->replace_dir_mode%3;
1436  *replace_file_mode= o->replace_file_mode%3;
1437  *dir_mode= o->dir_mode;
1438  *file_mode= o->file_mode;
1439  return(1);
1440 }
unsigned int replace_dir_mode
The following options set the default values for files and directory permissions, gid and uid.
Definition: isoburn.h:602
mode_t file_mode
Mode to use on dirs when replace_dir_mode == 2.
Definition: isoburn.h:608
unsigned int replace_file_mode
Definition: isoburn.h:603

References isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::replace_dir_mode, and isoburn_imgen_opts::replace_file_mode.

◆ isoburn_igopt_get_over_ugid()

int isoburn_igopt_get_over_ugid ( struct isoburn_imgen_opts o,
int *  replace_uid,
int *  replace_gid,
uid_t *  uid,
gid_t *  gid 
)

Definition at line 1454 of file isoburn.c.

1457 {
1458  *replace_uid= o->replace_uid%3;
1459  *replace_gid= o->replace_gid%3;
1460  *uid= o->uid;
1461  *gid= o->gid;
1462  return(1);
1463 }
unsigned int replace_uid
Definition: isoburn.h:604
uid_t uid
Mode to use on files when replace_file_mode == 2.
Definition: isoburn.h:609
unsigned int replace_gid
Definition: isoburn.h:605
gid_t gid
uid to use when replace_uid == 2.
Definition: isoburn.h:610

References isoburn_imgen_opts::gid, isoburn_imgen_opts::replace_gid, isoburn_imgen_opts::replace_uid, and isoburn_imgen_opts::uid.

◆ isoburn_igopt_get_part_flags()

int isoburn_igopt_get_part_flags ( struct isoburn_imgen_opts opts,
int  num_entries,
int  part_flags[] 
)

Inquire the current settings made by isoburn_igopt_set_part_flags().

Since
1.4.0
Parameters
optsThe option set to be inquired.
num_entriesNumber of array elements in part_flags[].
part_flagsThe array elements 0 to num_entries - 1 will get filled by the flag bits of the images of the corresponding partition.
Returns
<0 = error 0 = no partition image set >0 highest used partition number

Definition at line 1774 of file isoburn.c.

1776 {
1777  int i, max_entry= 0;
1778 
1779  for(i= 0; i < num_entries; i++)
1780  part_flags[i]= 0;
1781  for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
1782  if(i < num_entries)
1783  part_flags[i]= opts->appended_part_flags[i];
1784  max_entry= i + 1;
1785  }
1786  return(max_entry);
1787 }
int appended_part_flags[8]
Definition: isoburn.h:709

References isoburn_imgen_opts::appended_part_flags, and Libisoburn_max_appended_partitionS.

◆ isoburn_igopt_get_part_like_isohybrid()

int isoburn_igopt_get_part_like_isohybrid ( struct isoburn_imgen_opts opts,
int *  alike 
)

Inquire the current setting of isoburn_igopt_set_part_like_isohybrid().

Since
1.4.4
Parameters
optsThe option set to be inquired.
alikeReturns the current value.
Returns
<=0 = error, 1 = success

Definition at line 1870 of file isoburn.c.

1872 {
1873  *alike= opts->part_like_isohybrid;
1874  return(1);
1875 }
int part_like_isohybrid
Definition: isoburn.h:727

References isoburn_imgen_opts::part_like_isohybrid.

◆ isoburn_igopt_get_part_offset()

int isoburn_igopt_get_part_offset ( struct isoburn_imgen_opts opts,
uint32_t *  block_offset_2k,
int *  secs_512_per_head,
int *  heads_per_cyl 
)

Definition at line 1610 of file isoburn.c.

1613 {
1614  *block_offset_2k = opts->partition_offset;
1615  *secs_512_per_head = opts->partition_secs_per_head;
1616  *heads_per_cyl = opts->partition_heads_per_cyl;
1617  return 1;
1618 }
int partition_secs_per_head
Definition: isoburn.h:685
int partition_heads_per_cyl
Definition: isoburn.h:687
uint32_t partition_offset
Definition: isoburn.h:683

References isoburn_imgen_opts::partition_heads_per_cyl, isoburn_imgen_opts::partition_offset, and isoburn_imgen_opts::partition_secs_per_head.

◆ isoburn_igopt_get_part_type_guid()

int isoburn_igopt_get_part_type_guid ( struct isoburn_imgen_opts opts,
int  num_entries,
uint8_t  guids[][16],
int  valids[] 
)

Inquire the current settings made by isoburn_igopt_set_part_type_guid().

Since
1.5.2
Parameters
optsThe option set to be inquired.
num_entriesNumber of array elements in part_flags[].
type_guidsThe array elements 0 to num_entries - 1 will get filled by the 16 flag bits of the images of the corresponding partition.
validsThe array elements 0 to num_entries - 1 will get filled by 1 or 0 to indicate whether the corresponding type_guids element is valid.
Returns
<0 = error 0 = no partition image set >0 highest used partition number

Definition at line 1827 of file isoburn.c.

1830 {
1831  int i, max_entry= 0;
1832 
1833  for(i= 0; i < num_entries; i++) {
1834  memset(guids[i], 0, 16);
1835  valids[i]= 0;
1836  }
1837  for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
1838  if(i < num_entries) {
1839  memcpy(guids[i], opts->appended_part_type_guids[i], 16);
1840  valids[i]= opts->appended_part_gpt_flags[i] & 1;
1841  }
1842  max_entry= i + 1;
1843  }
1844  return(max_entry);
1845 }
uint8_t appended_part_type_guids[8][16]
Definition: isoburn.h:710
uint8_t appended_part_gpt_flags[8]
Definition: isoburn.h:715

References isoburn_imgen_opts::appended_part_gpt_flags, isoburn_imgen_opts::appended_part_type_guids, and Libisoburn_max_appended_partitionS.

◆ isoburn_igopt_get_partition_img()

int isoburn_igopt_get_partition_img ( struct isoburn_imgen_opts opts,
int  num_entries,
uint8_t  partition_types[],
char *  image_paths[] 
)

Inquire the current settings made by isoburn_igopt_set_partition_img().

Since
0.6.4
Parameters
optsThe option set to be inquired.
num_entriesNumber of array elements in partition_types[] and image_paths[].
partition_typesThe partition type associated with the partition. Valid only if image_paths[] of the same index is not NULL.
image_pathsIts elements get filled with either NULL or a pointer to a string with a file address or an empty text.
Returns
<0 = error 0 = no partition image set >0 highest used partition number

Definition at line 1735 of file isoburn.c.

1739 {
1740  int i, max_entry= 0;
1741 
1742  for(i= 0; i < num_entries; i++)
1743  image_paths[i]= NULL;
1744  for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
1745  if(opts->appended_partitions[i] == NULL)
1746  continue;
1747  if(i < num_entries) {
1748  image_paths[i]= opts->appended_partitions[i];
1749  partition_types[i]= opts->appended_part_types[i];
1750  }
1751  max_entry= i + 1;
1752  }
1753  return(max_entry);
1754 }
uint8_t appended_part_types[8]
Definition: isoburn.h:708
char * appended_partitions[8]
Definition: isoburn.h:707

References isoburn_imgen_opts::appended_part_types, isoburn_imgen_opts::appended_partitions, and Libisoburn_max_appended_partitionS.

◆ isoburn_igopt_get_prep_partition()

int isoburn_igopt_get_prep_partition ( struct isoburn_imgen_opts opts,
char **  path,
int  flag 
)

Definition at line 1673 of file isoburn.c.

1675 {
1676  *path= opts->prep_partition;
1677  if(flag & 1)
1678  return(1 + (opts->prep_part_flag & 0x3fffffff));
1679  return(1);
1680 }
char * prep_partition
Definition: isoburn.h:698

References isoburn_imgen_opts::prep_part_flag, and isoburn_imgen_opts::prep_partition.

◆ isoburn_igopt_get_pvd_times()

int isoburn_igopt_get_pvd_times ( struct isoburn_imgen_opts opts,
time_t *  creation_time,
time_t *  modification_time,
time_t *  expiration_time,
time_t *  effective_time,
char  uuid[17] 
)

Definition at line 1583 of file isoburn.c.

1587 {
1588  *vol_creation_time = opts->vol_creation_time;
1589  *vol_modification_time = opts->vol_modification_time;
1590  *vol_expiration_time = opts->vol_expiration_time;
1591  *vol_effective_time = opts->vol_effective_time;
1592  strcpy(vol_uuid, opts->vol_uuid);
1593  return(1);
1594 }
time_t vol_creation_time
Definition: isoburn.h:671
char vol_uuid[17]
Definition: isoburn.h:677
time_t vol_expiration_time
Definition: isoburn.h:673
time_t vol_modification_time
Definition: isoburn.h:672
time_t vol_effective_time
Definition: isoburn.h:674

References isoburn_imgen_opts::vol_creation_time, isoburn_imgen_opts::vol_effective_time, isoburn_imgen_opts::vol_expiration_time, isoburn_imgen_opts::vol_modification_time, and isoburn_imgen_opts::vol_uuid.

◆ isoburn_igopt_get_relaxed()

int isoburn_igopt_get_relaxed ( struct isoburn_imgen_opts o,
int *  relax 
)

Definition at line 1309 of file isoburn.c.

1310 {
1311  *relax= (!!o->omit_version_numbers) | ((!!o->allow_deep_paths)<<1) |
1312  ((!!o->allow_longer_paths)<<2) | ((!!o->max_37_char_filenames)<<3) |
1313  ((!!(o->no_force_dots & 1))<<4)| ((!!o->allow_lowercase)<<5) |
1314  ((!!o->allow_full_ascii)<<6) | ((!!o->joliet_longer_paths)<<7) |
1315  ((!!o->always_gmt)<<8) | ((!!o->rrip_version_1_10)<<9) |
1316  ((!!o->dir_rec_mtime)<<10) | ((!!o->aaip_susp_1_10)<<11) |
1317  ((!!(o->omit_version_numbers & 2))<<12) |
1318  ((!!(o->no_force_dots & 2))<<13) |
1319  ((!!o->allow_dir_id_ext) << 14) |
1320  ((!!o->joliet_long_names) << 15) |
1321  ((!!o->joliet_rec_mtime) << 16) |
1322  ((!!o->iso1999_rec_mtime) << 17) |
1323  ((!!o->allow_full_ascii) << 18) |
1324  ((!!o->joliet_utf16) << 19);
1325  return(1);
1326 }
unsigned int allow_dir_id_ext
Definition: isoburn.h:473
unsigned int iso1999_rec_mtime
Definition: isoburn.h:579
unsigned int joliet_rec_mtime
Definition: isoburn.h:578
unsigned int allow_lowercase
Allow lowercase characters in ISO-9660 filenames.
Definition: isoburn.h:529
unsigned int no_force_dots
ISO-9660 forces filenames to have a ".", that separates file name from extension.
Definition: isoburn.h:523
unsigned int allow_deep_paths
Allow ISO-9660 directory hierarchy to be deeper than 8 levels.
Definition: isoburn.h:486
unsigned int joliet_longer_paths
Allow paths in the Joliet tree to have more than 240 characters.
Definition: isoburn.h:547
unsigned int joliet_utf16
Use UTF-16BE rather than its subset UCS-2.
Definition: isoburn.h:558
unsigned int always_gmt
Store timestamps as GMT rather than in local time.
Definition: isoburn.h:563
unsigned int dir_rec_mtime
Store as ECMA-119 Directory Record timestamp the mtime of the source rather than the image creation t...
Definition: isoburn.h:577
unsigned int joliet_long_names
Allow leaf names in the Joliet tree to have up to 103 characters rather than 64.
Definition: isoburn.h:553
unsigned int allow_longer_paths
Allow path in the ISO-9660 tree to have more than 255 characters.
Definition: isoburn.h:506
unsigned int rrip_version_1_10
Write Rock Ridge info as of specification RRIP-1.10 rather than RRIP-1.12: signature "RRIP_1991A" rat...
Definition: isoburn.h:570
unsigned int aaip_susp_1_10
Write AAIP as extension according to SUSP 1.10 rather than SUSP 1.12.
Definition: isoburn.h:586
unsigned int max_37_char_filenames
Allow a single file or directory hierarchy to have up to 37 characters.
Definition: isoburn.h:514
unsigned int omit_version_numbers
Omit the version number (";1") at the end of the ISO-9660 identifiers.
Definition: isoburn.h:481
unsigned int allow_full_ascii
Allow all ASCII characters to be appear on an ISO-9660 filename.
Definition: isoburn.h:535

References isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_deep_paths, isoburn_imgen_opts::allow_dir_id_ext, isoburn_imgen_opts::allow_full_ascii, isoburn_imgen_opts::allow_longer_paths, isoburn_imgen_opts::allow_lowercase, isoburn_imgen_opts::always_gmt, isoburn_imgen_opts::dir_rec_mtime, isoburn_imgen_opts::iso1999_rec_mtime, isoburn_imgen_opts::joliet_long_names, isoburn_imgen_opts::joliet_longer_paths, isoburn_imgen_opts::joliet_rec_mtime, isoburn_imgen_opts::joliet_utf16, isoburn_imgen_opts::max_37_char_filenames, isoburn_imgen_opts::no_force_dots, isoburn_imgen_opts::omit_version_numbers, and isoburn_imgen_opts::rrip_version_1_10.

◆ isoburn_igopt_get_rr_reloc()

int isoburn_igopt_get_rr_reloc ( struct isoburn_imgen_opts o,
char **  name,
int *  flags 
)

Obtain the settings of isoburn_igopt_set_rr_reloc().

Since
1.2.2
Parameters
oThe option set to work on
nameWill return NULL or a pointer to the name of the relocation directory in the root directory. Do not alter or dispose the memory which holds this name.
flagsWill return the flags bitfield.
Returns
> 0 success, <= 0 failure

Definition at line 1351 of file isoburn.c.

1353 {
1354  *name= o->rr_reloc_dir;
1355  *flags= o->rr_reloc_flags;
1356  return(1);
1357 }
char * rr_reloc_dir
If not allow_deep_paths is in effect, then it may become necessary to relocate directories so that no...
Definition: isoburn.h:495

References isoburn_imgen_opts::rr_reloc_dir, and isoburn_imgen_opts::rr_reloc_flags.

◆ isoburn_igopt_get_scdbackup_tag()

int isoburn_igopt_get_scdbackup_tag ( struct isoburn_imgen_opts o,
char  name[81],
char  timestamp[19],
char **  tag_written 
)

Definition at line 1524 of file isoburn.c.

1527 {
1528  strncpy(name, o->scdbackup_tag_name, 80);
1529  name[80]= 0;
1530  strncpy(timestamp, o->scdbackup_tag_time, 18);
1531  timestamp[18]= 0;
1532  *tag_written= o->scdbackup_tag_written;
1533  return(1);
1534 }
char * scdbackup_tag_written
Definition: isoburn.h:654
char scdbackup_tag_name[81]
If not empty: Parameters "name" and "timestamp" for a scdbackup stream checksum tag.
Definition: isoburn.h:652
char scdbackup_tag_time[19]
Definition: isoburn.h:653

References isoburn_imgen_opts::scdbackup_tag_name, isoburn_imgen_opts::scdbackup_tag_time, and isoburn_imgen_opts::scdbackup_tag_written.

◆ isoburn_igopt_get_sort_files()

int isoburn_igopt_get_sort_files ( struct isoburn_imgen_opts o,
int *  value 
)

Definition at line 1412 of file isoburn.c.

1413 {
1414  *value= !!o->sort_files;
1415  return(1);
1416 }
unsigned int sort_files
If files should be sorted based on their weight.
Definition: isoburn.h:588

References isoburn_imgen_opts::sort_files.

◆ isoburn_igopt_get_stdio_endsync()

int isoburn_igopt_get_stdio_endsync ( struct isoburn_imgen_opts opts,
int *  do_sync 
)

Definition at line 2031 of file isoburn.c.

2033 {
2034  *do_sync= opts->do_fsync;
2035  return(1);
2036 }

References isoburn_imgen_opts::do_fsync.

◆ isoburn_igopt_get_system_area()

int isoburn_igopt_get_system_area ( struct isoburn_imgen_opts o,
char  data[32768],
int *  options 
)

Definition at line 1557 of file isoburn.c.

1559 {
1560  *options= opts->system_area_options;
1561  if(opts->system_area_data == NULL)
1562  return(0);
1563  memcpy(data, opts->system_area_data, 32768);
1564  return(1);
1565 }

References isoburn_imgen_opts::system_area_data, and isoburn_imgen_opts::system_area_options.

◆ isoburn_igopt_get_tail_blocks()

int isoburn_igopt_get_tail_blocks ( struct isoburn_imgen_opts opts,
uint32_t *  num_blocks 
)

Definition at line 1646 of file isoburn.c.

1648 {
1649  *num_blocks = opts->tail_blocks;
1650  return 1;
1651 }
uint32_t tail_blocks
Definition: isoburn.h:695

References isoburn_imgen_opts::tail_blocks.

◆ isoburn_igopt_get_untranslated_name_len()

int isoburn_igopt_get_untranslated_name_len ( struct isoburn_imgen_opts o,
int *  len 
)

Definition at line 1397 of file isoburn.c.

1399 {
1400  *len = o->untranslated_name_len;
1401  return(1);
1402 }
unsigned int untranslated_name_len
Definition: isoburn.h:464

References isoburn_imgen_opts::untranslated_name_len.

◆ isoburn_igopt_get_write_type()

int isoburn_igopt_get_write_type ( struct isoburn_imgen_opts opts,
int *  do_tao 
)

Definition at line 2018 of file isoburn.c.

2019 {
2020  *do_tao= opts->do_tao;
2021  return(1);
2022 }

References isoburn_imgen_opts::do_tao.

◆ isoburn_igopt_new()

int isoburn_igopt_new ( struct isoburn_imgen_opts **  o,
int  flag 
)

Produces a set of generation and transfer options, initialized with default values.

Since
0.1.0
Parameters
othe newly created option set object
flagBitfield for control purposes. Submit 0 for now.
Returns
1=ok , <0 = failure

Definition at line 1125 of file isoburn.c.

1126 {
1127  struct isoburn_imgen_opts *o;
1128  int i;
1129 
1130  o= (*new_o)= calloc(1, sizeof(struct isoburn_imgen_opts));
1131  if(o==NULL) {
1132  isoburn_msgs_submit(NULL, 0x00060000,
1133  "Cannot allocate memory for image generation options",
1134  0, "FATAL", 0);
1135  return(-1);
1136  }
1137  o->level= 2;
1138  o->rockridge= 1;
1139  o->joliet= 0;
1140  o->iso1999= 0;
1141  o->hardlinks= 0;
1142  o->aaip = 0;
1143  o->session_md5= 0;
1144  o->file_md5= 0;
1145  o->no_emul_toc= 0;
1146  o->old_empty= 0;
1147  o->untranslated_name_len = 0;
1148  o->allow_dir_id_ext = 0;
1149  o->omit_version_numbers= 0;
1150  o->allow_deep_paths= 1;
1151  o->rr_reloc_dir= NULL;
1152  o->rr_reloc_flags= 0;
1153  o->allow_longer_paths= 0;
1154  o->max_37_char_filenames= 0;
1155  o->no_force_dots= 0;
1156  o->allow_lowercase= 0;
1157  o->allow_full_ascii= 0;
1158  o->allow_7bit_ascii= 0;
1159  o->joliet_longer_paths= 0;
1160  o->joliet_long_names= 0;
1161  o->joliet_utf16= 0;
1162  o->always_gmt= 0;
1163  o->rrip_version_1_10= 0;
1164  o->dir_rec_mtime= 0;
1165  o->aaip_susp_1_10= 0;
1166  o->sort_files= 0;
1167  o->replace_dir_mode= 0;
1168  o->replace_file_mode= 0;
1169  o->replace_uid= 0;
1170  o->replace_gid= 0;
1171  o->dir_mode= 0555;
1172  o->file_mode= 0444;
1173  o->uid= 0;
1174  o->gid= 0;
1175  o->output_charset= NULL;
1176  o->fifo_size= 4*1024*1024;
1177  o->effective_lba= -1;
1178  o->data_start_lba= -1;
1179  o->system_area_data= NULL;
1180  o->system_area_options= 0;
1181  o->partition_offset= 0;
1184  o->vol_creation_time= 0;
1185  o->vol_modification_time= 0;
1186  o->vol_expiration_time= 0;
1187  o->vol_effective_time= 0;
1188  o->libjte_handle= NULL;
1189  o->tail_blocks= 0;
1190  o->prep_partition= NULL;
1191  o->prep_part_flag= 0;
1192  o->efi_boot_partition= NULL;
1193  o->efi_boot_part_flag= 0;
1194  for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
1195  o->appended_partitions[i]= NULL;
1196  o->appended_part_types[i]= 0;
1197  o->appended_part_flags[i]= 0;
1198  memset(o->appended_part_type_guids[i], 0, 16);
1199  o->appended_part_gpt_flags[i]= 0;
1200  }
1201  o->appended_as_gpt= 0;
1202  o->appended_as_apm= 0;
1203  o->part_like_isohybrid= 0;
1204  o->iso_mbr_part_type= -1;
1205  memset(o->gpt_guid, 0, 16);
1206  o->gpt_guid_mode= 0;
1207  memset(o->hfsp_serial_number, 0, 8);
1208  o->hfsp_block_size= 0;
1209  o->apm_block_size= 0;
1210  o->do_tao= 0;
1211  o->do_fsync= 0;
1212  return(1);
1213 }
Options for image generation by libisofs and image transport to libburn.
Definition: isoburn.h:409
char * system_area_data
Definition: isoburn.h:660
int system_area_options
Definition: isoburn.h:668
unsigned int allow_7bit_ascii
Like allow_full_ascii, but only allowing 7-bit characters.
Definition: isoburn.h:542

References isoburn_imgen_opts::aaip, isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_7bit_ascii, isoburn_imgen_opts::allow_deep_paths, isoburn_imgen_opts::allow_dir_id_ext, isoburn_imgen_opts::allow_full_ascii, isoburn_imgen_opts::allow_longer_paths, isoburn_imgen_opts::allow_lowercase, isoburn_imgen_opts::always_gmt, isoburn_imgen_opts::apm_block_size, isoburn_imgen_opts::appended_as_apm, isoburn_imgen_opts::appended_as_gpt, isoburn_imgen_opts::appended_part_flags, isoburn_imgen_opts::appended_part_gpt_flags, isoburn_imgen_opts::appended_part_type_guids, isoburn_imgen_opts::appended_part_types, isoburn_imgen_opts::appended_partitions, isoburn_imgen_opts::data_start_lba, isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::dir_rec_mtime, isoburn_imgen_opts::do_fsync, isoburn_imgen_opts::do_tao, isoburn_imgen_opts::effective_lba, isoburn_imgen_opts::efi_boot_part_flag, isoburn_imgen_opts::efi_boot_partition, isoburn_imgen_opts::fifo_size, isoburn_imgen_opts::file_md5, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::gid, isoburn_imgen_opts::gpt_guid, isoburn_imgen_opts::gpt_guid_mode, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::hfsp_block_size, isoburn_imgen_opts::hfsp_serial_number, isoburn_imgen_opts::iso1999, isoburn_imgen_opts::iso_mbr_part_type, isoburn_msgs_submit(), isoburn_imgen_opts::joliet, isoburn_imgen_opts::joliet_long_names, isoburn_imgen_opts::joliet_longer_paths, isoburn_imgen_opts::joliet_utf16, isoburn_imgen_opts::level, Libisoburn_max_appended_partitionS, isoburn_imgen_opts::libjte_handle, isoburn_imgen_opts::max_37_char_filenames, isoburn_imgen_opts::no_emul_toc, isoburn_imgen_opts::no_force_dots, isoburn_imgen_opts::old_empty, isoburn_imgen_opts::omit_version_numbers, isoburn_imgen_opts::output_charset, isoburn_imgen_opts::part_like_isohybrid, isoburn_imgen_opts::partition_heads_per_cyl, isoburn_imgen_opts::partition_offset, isoburn_imgen_opts::partition_secs_per_head, isoburn_imgen_opts::prep_part_flag, isoburn_imgen_opts::prep_partition, isoburn_imgen_opts::replace_dir_mode, isoburn_imgen_opts::replace_file_mode, isoburn_imgen_opts::replace_gid, isoburn_imgen_opts::replace_uid, isoburn_imgen_opts::rockridge, isoburn_imgen_opts::rr_reloc_dir, isoburn_imgen_opts::rr_reloc_flags, isoburn_imgen_opts::rrip_version_1_10, isoburn_imgen_opts::session_md5, isoburn_imgen_opts::sort_files, isoburn_imgen_opts::system_area_data, isoburn_imgen_opts::system_area_options, isoburn_imgen_opts::tail_blocks, isoburn_imgen_opts::uid, isoburn_imgen_opts::untranslated_name_len, isoburn_imgen_opts::vol_creation_time, isoburn_imgen_opts::vol_effective_time, isoburn_imgen_opts::vol_expiration_time, and isoburn_imgen_opts::vol_modification_time.

Referenced by Xorriso_relax_compliance(), Xorriso_test_outchar(), and Xorriso_write_session().

◆ isoburn_igopt_set_appended_as_apm()

int isoburn_igopt_set_appended_as_apm ( struct isoburn_imgen_opts opts,
int  apm 
)

Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in Apple Partition Map.

Since
1.4.4
Parameters
optsThe option set to be manipulated.
apm0= do not represent appended partitions in APM 1= represent in APM, even if not iso_write_opts_set_part_like_isohybrid() enables it and no other APM partitions emerge. Do not use other values for now.
Returns
<=0 = error, 1 = success

Definition at line 1847 of file isoburn.c.

1848 {
1849  opts->appended_as_apm= !!apm;
1850  return(1);
1851 }

References isoburn_imgen_opts::appended_as_apm.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_appended_as_gpt()

int isoburn_igopt_set_appended_as_gpt ( struct isoburn_imgen_opts opts,
int  gpt 
)

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
Parameters
optsThe option set to be manipulated.
gpt0= represent as MBR partition; as GPT only if other GPT partitions are present 1= represent as GPT partition and cause protective MBR with a single partition which covers the whole output data. This may fail if other settings demand MBR partitions. Do not use other values for now.
Returns
<=0 = error, 1 = success

Definition at line 1790 of file isoburn.c.

1791 {
1792  opts->appended_as_gpt= !!gpt;
1793  return(1);
1794 }

References isoburn_imgen_opts::appended_as_gpt.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_disc_label()

int isoburn_igopt_set_disc_label ( struct isoburn_imgen_opts opts,
char *  label 
)

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
Parameters
optsThe option set to be manipulated.
labelA text of up to 128 characters.
Returns
<=0 = error, 1 = success

Definition at line 1940 of file isoburn.c.

1941 {
1942  strncpy(opts->ascii_disc_label, label, Libisoburn_disc_label_sizE - 1);
1944  return(1);
1945 }
#define Libisoburn_disc_label_sizE
Definition: isoburn.h:62

References isoburn_imgen_opts::ascii_disc_label, and Libisoburn_disc_label_sizE.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_efi_bootp()

int isoburn_igopt_set_efi_bootp ( struct isoburn_imgen_opts opts,
char *  path,
int  flag 
)

Copy a data file from the local filesystem into the emerging ISO image and mark it by a GPT entry as EFI system partition.

Since
1.2.4
Parameters
optsThe option set to be manipulated.
pathFile address in the local file system. Instead of a disk path, the word –efi-boot-image may be given. It exposes in GPT the content of the first El Torito EFI boot image as EFI system partition.
flagWith isoburn_igopt_get_efi_bootp(): Control bits as of iso_write_opts_set_efi_bootp() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h.
Since
1.4.0 With isoburn_igopt_set_efi_bootp(): bit0= add the current flag setting & 0x3fffffff to return value 1.
Returns
1 success, <=0 failure

Definition at line 1683 of file isoburn.c.

1685 {
1686  if(o->efi_boot_partition != NULL)
1687  free(o->efi_boot_partition);
1688  o->efi_boot_partition= NULL;
1689  o->efi_boot_part_flag= 0;
1690  if(path != NULL) {
1691  o->efi_boot_partition= strdup(path);
1692  if(o->efi_boot_partition == NULL) {
1693  isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0);
1694  return(-1);
1695  }
1696  }
1697  o->efi_boot_part_flag = flag & 1;
1698  return(1);
1699 }

References isoburn_imgen_opts::efi_boot_part_flag, isoburn_imgen_opts::efi_boot_partition, and isoburn_report_iso_error().

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_extensions()

int isoburn_igopt_set_extensions ( struct isoburn_imgen_opts o,
int  ext 
)

Definition at line 1253 of file isoburn.c.

1254 {
1255  o->rockridge= !!(ext&1);
1256  o->joliet= !!(ext&2);
1257  o->iso1999= !!(ext&4);
1258  o->hardlinks= !!(ext & 8);
1259  o->aaip= !!(ext & 32);
1260  o->session_md5= !!(ext & 64);
1261  o->file_md5= (ext & (128 | 256)) >> 7;
1262  o->no_emul_toc= !!(ext & 512);
1263  o->will_cancel= !!(ext & 1024);
1264  o->old_empty= !!(ext & 2048);
1265  o->hfsplus= !!(ext & 4096);
1266  o->fat= !!(ext & 8192);
1267  return(1);
1268 }

References isoburn_imgen_opts::aaip, isoburn_imgen_opts::fat, isoburn_imgen_opts::file_md5, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::hfsplus, isoburn_imgen_opts::iso1999, isoburn_imgen_opts::joliet, isoburn_imgen_opts::no_emul_toc, isoburn_imgen_opts::old_empty, isoburn_imgen_opts::rockridge, isoburn_imgen_opts::session_md5, and isoburn_imgen_opts::will_cancel.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_fifo_size()

int isoburn_igopt_set_fifo_size ( struct isoburn_imgen_opts o,
int  fifo_size 
)

The number of bytes to be used for the fifo which decouples libisofs and libburn for better throughput and for reducing the risk of interrupting signals hitting the libburn thread which operates the MMC drive.

The size will be rounded up to the next full 2048. Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).

Since
0.1.0
Parameters
oThe option set to work on
fifo_sizeNumber of bytes to use
Returns
1 success, <=0 failure

Definition at line 1482 of file isoburn.c.

1483 {
1484  o->fifo_size= fifo_size;
1485  return(1);
1486 }

References isoburn_imgen_opts::fifo_size.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_gpt_guid()

int isoburn_igopt_set_gpt_guid ( struct isoburn_imgen_opts opts,
uint8_t  guid[16],
int  mode 
)

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 little-endian 32 bit counter with the disk GUID beginning at byte offset 9.

Since
1.4.6
Parameters
optsThe option set to be manipulated.
guid16 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 variant of GUID, where version 4 means "random".
mode0 = ignore parameter guid and produce the GPT disk GUID by a pseudo-random algorithm. This is the default setting. 1 = use parameter guid as GPT disk GUID 2 = ignore parameter guid and derive the GPT disk GUID from parameter uuid of isoburn_igopt_set_pvd_times(). The 16 bytes of uuid get copied and bytes 6, 7, 8 get their upper bits changed to comply to RFC 4122. If no such uuid is given when ISO production starts, then mode 2 defaults to mode 0.

Definition at line 1914 of file isoburn.c.

1916 {
1917  if(mode < 0 || mode > 2) {
1918  isoburn_msgs_submit(NULL, 0x00060000,
1919  "Unrecognized GPT disk GUID setup mode. (0 ... 2)",
1920  0, "FAILURE", 0);
1921  return(0);
1922  }
1923  opts->gpt_guid_mode= mode;
1924  if(opts->gpt_guid_mode == 1)
1925  memcpy(opts->gpt_guid, guid, 16);
1926  return 1;
1927 }

References isoburn_imgen_opts::gpt_guid, isoburn_imgen_opts::gpt_guid_mode, and isoburn_msgs_submit().

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_hfsp_block_size()

int isoburn_igopt_set_hfsp_block_size ( struct isoburn_imgen_opts opts,
int  hfsp_block_size,
int  apm_block_size 
)

Set the allocation block size for HFS+ production and the block size for layout and address unit of Apple Partition map.

Since
1.2.4
Parameters
optsThe option set to be manipulated.
hfsp_block_size-1 means that this setting shall be left unchanged 0 allows the automatic default setting 512 and 2048 enforce a size.
apm_block_size-1 means that this setting shall be left unchanged 0 allows the automatic default setting 512 and 2048 enforce a size. Size 512 cannot be combined with GPT production. Size 2048 cannot be mounted -t hfsplus by Linux kernels at least up to 2.6.32.
Returns
<=0 = error, 1 = success

Definition at line 1971 of file isoburn.c.

1973 {
1974  char msg[80];
1975 
1976  msg[0]= 0;
1977  if(hfsp_block_size != -1) {
1978  if(hfsp_block_size != 0 && hfsp_block_size != 512 &&
1979  hfsp_block_size != 2048) {
1980  sprintf(msg, "Not a supported HFS+ size (%d <-> 0, 512, 2048)",
1981  hfsp_block_size);
1982  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1983  }
1984  opts->hfsp_block_size = hfsp_block_size;
1985  }
1986  if(apm_block_size != -1) {
1987  if(apm_block_size != 0 && apm_block_size != 512 && apm_block_size != 2048) {
1988  sprintf(msg, "Not a supported APM block size (%d <-> 0, 512, 2048)",
1989  apm_block_size);
1990  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1991  }
1992  opts->apm_block_size = apm_block_size;
1993  }
1994  if(msg[0])
1995  return(0);
1996  return(1);
1997 }

References isoburn_imgen_opts::apm_block_size, isoburn_imgen_opts::hfsp_block_size, and isoburn_msgs_submit().

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_hfsp_serial_number()

int isoburn_igopt_set_hfsp_serial_number ( struct isoburn_imgen_opts opts,
uint8_t  serial_number[8] 
)

Set a serial number for the HFS+ extension of the emerging ISO image.

Since
1.2.4
Parameters
optsThe option set to be manipulated.
serial_number8 bytes which should be unique to the image. If all bytes are 0, then the serial number will be generated as random number by libisofs. This is the default setting.
Returns
<=0 = error, 1 = success

Definition at line 1955 of file isoburn.c.

1957 {
1958  memcpy(opts->hfsp_serial_number, serial_number, 8);
1959  return(1);
1960 }

References isoburn_imgen_opts::hfsp_serial_number.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_iso_mbr_part_type()

int isoburn_igopt_set_iso_mbr_part_type ( struct isoburn_imgen_opts opts,
int  part_type 
)

Set the partition type of the MBR partition which represents the ISO filesystem or at least protects it.

This is without effect if no such partition emerges by other settings or if the partition type is prescribed mandatorily like 0xee for GPT protective MBR or 0x96 for CHRP.

Since
1.4.8
Parameters
optsThe option set to be manipulated.
part_type0x00 to 0xff as desired partition type. Any other value (e.g. -1) enables the default types of the various occasions.

Definition at line 1878 of file isoburn.c.

1880 {
1881  if(part_type < -1 || part_type > 255)
1882  part_type = -1;
1883  opts->iso_mbr_part_type = part_type;
1884  return(1);
1885 }

References isoburn_imgen_opts::iso_mbr_part_type.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_iso_type_guid()

int isoburn_igopt_set_iso_type_guid ( struct isoburn_imgen_opts opts,
uint8_t  guid[16],
int  valid 
)

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
Parameters
optsThe option set to be manipulated.
guid16 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.
validSet 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.
Returns
<=0 = error, 1 = success

Definition at line 1896 of file isoburn.c.

1898 {
1899  if(valid)
1900  memcpy(opts->iso_gpt_type_guid, guid, 16);
1901  opts->iso_gpt_flag= (opts->iso_gpt_flag & ~1) | !!valid;
1902  return(1);
1903 }

References isoburn_imgen_opts::iso_gpt_flag, and isoburn_imgen_opts::iso_gpt_type_guid.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_level()

int isoburn_igopt_set_level ( struct isoburn_imgen_opts o,
int  level 
)

ISO level to write at.

Since
0.1.0
Parameters
oThe option set to work on
levelis a term of the ISO 9660 standard. It should be one of: 1= filenames restricted to form 8.3 2= filenames allowed up to 31 characters 3= file content may be larger than 4 GB - 1.
Returns
1 success, <=0 failure

Definition at line 1239 of file isoburn.c.

1240 {
1241  o->level= level;
1242  return(1);
1243 }

References isoburn_imgen_opts::level.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_out_charset()

int isoburn_igopt_set_out_charset ( struct isoburn_imgen_opts o,
char *  output_charset 
)

Set the character set to use for representing RR filenames in the image.

Since
0.1.0
Parameters
oThe option set to work on
output_charsetSet this to NULL to use the default output charset. For selecting a particular character set, submit its name, e.g. as listed by program iconv -l. Example: "UTF-8".
Returns
1 success, <=0 failure

Definition at line 1466 of file isoburn.c.

1468 {
1469  o->output_charset= output_charset;
1470  return(1);
1471 }

References isoburn_imgen_opts::output_charset.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_over_mode()

int isoburn_igopt_set_over_mode ( struct isoburn_imgen_opts o,
int  replace_dir_mode,
int  replace_file_mode,
mode_t  dir_mode,
mode_t  file_mode 
)

Set the override values for files and directory permissions.

The parameters replace_* these take one of three values: 0, 1 or 2. If 0, the corresponding attribute will be kept as set in the IsoNode at the time of image generation. If set to 1, the corresponding attrib. will be changed by a default suitable value. With value 2, the attrib. will be changed with the value specified in the corresponding *_mode options. Note that only the permissions are set, the file type remains unchanged.

Since
0.1.0
Parameters
oThe option set to work on
replace_dir_modewhether and how to override directories
replace_file_modewhether and how to override files of other type
dir_modeMode to use on dirs with replace_dir_mode == 2.
file_mode;Mode to use on files with replace_file_mode == 2.
Returns
1 success, <=0 failure

Definition at line 1419 of file isoburn.c.

1422 {
1423  o->replace_dir_mode= replace_dir_mode%3;
1424  o->replace_file_mode= replace_file_mode%3;
1425  o->dir_mode= dir_mode;
1426  o->file_mode= file_mode;
1427  return(1);
1428 }

References isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::replace_dir_mode, and isoburn_imgen_opts::replace_file_mode.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_over_ugid()

int isoburn_igopt_set_over_ugid ( struct isoburn_imgen_opts o,
int  replace_uid,
int  replace_gid,
uid_t  uid,
gid_t  gid 
)

Set the override values values for group id and user id.

The rules are like with above overriding of mode values. replace_* controls whether and how. The other two parameters provide values for eventual use.

Since
0.1.0
Parameters
oThe option set to work on
replace_uidwhether and how to override user ids
replace_gidwhether and how to override group ids
uidUser id to use with replace_uid == 2.
gidGroup id to use on files with replace_gid == 2.
Returns
1 success, <=0 failure

Definition at line 1443 of file isoburn.c.

1446 {
1447  o->replace_uid= replace_uid%3;
1448  o->replace_gid= replace_gid%3;
1449  o->uid= uid;
1450  o->gid= gid;
1451  return(1);
1452 }

References isoburn_imgen_opts::gid, isoburn_imgen_opts::replace_gid, isoburn_imgen_opts::replace_uid, and isoburn_imgen_opts::uid.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_part_flag()

int isoburn_igopt_set_part_flag ( struct isoburn_imgen_opts opts,
int  partition_number,
int  flag 
)

Set flag bits for a partition defined by isoburn_igopt_set_partition_img().

The bits will be forwarded to libisofs iso_write_opts_set_partition_img().

Since
1.4.0
Parameters
optsThe option set to be manipulated.
partition_numberDepicts the partition table entry to which shall the flags bits shall apply.
flagControl bits as of iso_write_opts_set_partition_img() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h.
Since
1.4.0
Returns
<=0 = error, 1 = success

Definition at line 1757 of file isoburn.c.

1759 {
1760  char msg[80];
1761 
1762  if (partition_number < 1 ||
1763  partition_number > Libisoburn_max_appended_partitionS) {
1764  sprintf(msg, "Partition number is out of range (1 ... %d)",
1766  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1767  return(0);
1768  }
1769  opts->appended_part_flags[partition_number - 1]= flag;
1770  return(1);
1771 }

References isoburn_imgen_opts::appended_part_flags, isoburn_msgs_submit(), and Libisoburn_max_appended_partitionS.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_part_like_isohybrid()

int isoburn_igopt_set_part_like_isohybrid ( struct isoburn_imgen_opts opts,
int  alike 
)

Control whether bits 2 to 8 of el_torito_set_isolinux_options() shall apply even if not isohybrid MBR patching is enabled (bit1 of parameter options of isoburn_igopt_set_system_area()).

For details see iso_write_opts_set_part_like_isohybrid() in libisofs.h.

Since
1.4.4
Parameters
optsThe option set to be manipulated.
alike0= Apply isohybrid behavior only with ISOLINUX isohybrid. Do not mention appended partitions in APM unless isoburn_igopt_set_appended_as_apm() is enabled. 1= Apply isohybrid behavior even without ISOLINUX isohybrid.
Returns
<=0 = error, 1 = success

Definition at line 1862 of file isoburn.c.

1864 {
1865  opts->part_like_isohybrid= !!alike;
1866  return(1);
1867 }

References isoburn_imgen_opts::part_like_isohybrid.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_part_offset()

int isoburn_igopt_set_part_offset ( struct isoburn_imgen_opts opts,
uint32_t  block_offset_2k,
int  secs_512_per_head,
int  heads_per_cyl 
)

Control production of a second set of volume descriptors (superblock) and directory trees, together with a partition table in the MBR where the first partition has non-zero start address and the others are zeroed.

The first partition stretches to the end of the whole ISO image. The additional volume descriptor set and trees can be used to mount the ISO image at the start of the first partition, while it is still possible to mount it via the normal first volume descriptor set and tree at the start of the image or storage device. This makes few sense on optical media. But on USB sticks it creates a conventional partition table which makes it mountable on e.g. Linux via /dev/sdb and /dev/sdb1 alike.

Since
0.6.2
Parameters
optsThe option set to be manipulated.
block_offset_2kThe offset of the partition start relative to device start. This is counted in 2 kB blocks. The partition table will show the according number of 512 byte sectors. Default is 0 which causes no second set and trees. If it is not 0 then it must not be smaller than 16.
secs_512_per_headNumber of 512 byte sectors per head. 1 to 63. 0=automatic.
heads_per_cylNumber of heads per cylinder. 1 to 255. 0=automatic.
Returns
1 success, <=0 failure

Definition at line 1597 of file isoburn.c.

1600 {
1601  if (block_offset_2k > 0 && block_offset_2k < 16)
1602  return(0);
1603  opts->partition_offset = block_offset_2k;
1604  opts->partition_secs_per_head = secs_512_per_head;
1605  opts->partition_heads_per_cyl = heads_per_cyl;
1606  return(1);
1607 }

References isoburn_imgen_opts::partition_heads_per_cyl, isoburn_imgen_opts::partition_offset, and isoburn_imgen_opts::partition_secs_per_head.

Referenced by Xorriso_set_system_area().

◆ isoburn_igopt_set_part_type_guid()

int isoburn_igopt_set_part_type_guid ( struct isoburn_imgen_opts opts,
int  partition_number,
uint8_t  guid[16],
int  valid 
)

Set the GPT Type GUID for a partition defined by isoburn_igopt_set_partition_img().

Since
1.5.2
Parameters
optsThe option set to be manipulated.
partition_numberDepicts the partition table entry which shall get the Type GUID.
guid16 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.
validSet 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.
Returns
<=0 = error, 1 = success

Definition at line 1805 of file isoburn.c.

1808 {
1809  char msg[80];
1810 
1811  if (partition_number < 1 ||
1812  partition_number > Libisoburn_max_appended_partitionS) {
1813  sprintf(msg, "Partition number is out of range (1 ... %d)",
1815  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1816  return(0);
1817  }
1818  if(valid)
1819  memcpy(opts->appended_part_type_guids[partition_number - 1], guid, 16);
1820  if(valid)
1821  opts->appended_part_gpt_flags[partition_number - 1]|= 1;
1822  else
1823  opts->appended_part_gpt_flags[partition_number - 1]&= ~1;
1824  return(1);
1825 }

References isoburn_imgen_opts::appended_part_gpt_flags, isoburn_imgen_opts::appended_part_type_guids, isoburn_msgs_submit(), and Libisoburn_max_appended_partitionS.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_partition_img()

int isoburn_igopt_set_partition_img ( struct isoburn_imgen_opts opts,
int  partition_number,
uint8_t  partition_type,
char *  image_path 
)

Cause an arbitrary data file to be appended to the ISO image and to be described by a partition table entry in an MBR or SUN Disk Label at the start of the ISO image.

The partition entry will bear the size of the image file rounded up to 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
Parameters
optsThe option set to be manipulated.
partition_numberDepicts the partition table entry which shall describe the appended image. Range with MBR: 1 to 4. 1 will cause the whole ISO image to be unclaimable space before partition 1.
Since
0.6.6 Range with SUN Disk Label: 2 to 8.
Parameters
image_pathFile 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.
partition_typeThe MBR partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06, Linux Native Partition = 0x83. See fdisk command L. This parameter is ignored with SUN Disk Label.
Returns
<=0 = error, 1 = success

Definition at line 1712 of file isoburn.c.

1715 {
1716  char msg[80];
1717 
1718  if (partition_number < 1 ||
1719  partition_number > Libisoburn_max_appended_partitionS) {
1720  sprintf(msg, "Partition number is out of range (1 ... %d)",
1722  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1723  return(0);
1724  }
1725  if (opts->appended_partitions[partition_number - 1] != NULL)
1726  free(opts->appended_partitions[partition_number - 1]);
1727  opts->appended_partitions[partition_number - 1] = strdup(image_path);
1728  if (opts->appended_partitions[partition_number - 1] == NULL)
1729  return(-1);
1730  opts->appended_part_types[partition_number - 1] = partition_type;
1731  return(1);
1732 }

References isoburn_imgen_opts::appended_part_types, isoburn_imgen_opts::appended_partitions, isoburn_msgs_submit(), and Libisoburn_max_appended_partitionS.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_prep_partition()

int isoburn_igopt_set_prep_partition ( struct isoburn_imgen_opts opts,
char *  path,
int  flag 
)

Copy a data file from the local filesystem into the emerging ISO image.

Mark it by an MBR partition entry as PreP partition and also cause protective MBR partition entries before and after this partition. See libisofs.h iso_write_opts_set_prep_img().

Since
1.2.4
Parameters
optsThe option set to be manipulated.
pathFile address in the local file system.
flagWith isoburn_igopt_set_prep_partition(): Control bits as of iso_write_opts_set_efi_bootp() bit0= The path contains instructions for the interval libisofs reader. See libisofs.h.
Since
1.4.0 With isoburn_igopt_get_prep_partition(): bit0= add the current flag setting & 0x3fffffff to return value 1.
Returns
1 success, <=0 failure

Definition at line 1654 of file isoburn.c.

1656 {
1657  if(o->prep_partition != NULL)
1658  free(o->prep_partition);
1659  o->prep_partition= NULL;
1660  o->prep_part_flag= 0;
1661  if(path != NULL) {
1662  o->prep_partition= strdup(path);
1663  if(o->prep_partition == NULL) {
1664  isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0);
1665  return(-1);
1666  }
1667  }
1668  o->prep_part_flag= flag & 1;
1669  return(1);
1670 }

References isoburn_report_iso_error(), isoburn_imgen_opts::prep_part_flag, and isoburn_imgen_opts::prep_partition.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_pvd_times()

int isoburn_igopt_set_pvd_times ( struct isoburn_imgen_opts opts,
time_t  creation_time,
time_t  modification_time,
time_t  expiration_time,
time_t  effective_time,
char *  uuid 
)

Explicitly set the four timestamps of the emerging ISO image.

Default with all parameters is 0.

Since
0.5.4
Parameters
optsThe option set to work on
creation_timeECMA-119 Volume Creation Date and Time When "the information in the volume was created." A value of 0 means that the timepoint of write start is to be used.
modification_timeECMA-119 Volume Modification Date and Time When "the informationin the volume was last modified." A value of 0 means that the timepoint of write start is to be used.
expiration_timeECMA-119 Volume Expiration Date and Time When "the information in the volume may be regarded as obsolete." A value of 0 means that the information never shall expire.
effective_timeECMA-119 Volume Effective Date and Time When "the information in the volume may be used." A value of 0 means that not such retention is intended.
uuidIf this text is not empty, then it overrides vol_modification_time by copying the first 16 decimal digits from uuid, eventually padding up with decimal '1', and writing a NUL-byte as timezone GMT. It should express a reasonable time in form YYYYMMDDhhmmsscc E.g.: 2010040711405800 = 7 Apr 2010 11:40:58 (+0 centiseconds)
Returns
1 success, <=0 failure

Definition at line 1568 of file isoburn.c.

1572 {
1573  opts->vol_creation_time = vol_creation_time;
1574  opts->vol_modification_time = vol_modification_time;
1575  opts->vol_expiration_time = vol_expiration_time;
1576  opts->vol_effective_time = vol_effective_time;
1577  strncpy(opts->vol_uuid, vol_uuid, 16);
1578  opts->vol_uuid[16] = 0;
1579  return(1);
1580 }

References isoburn_imgen_opts::vol_creation_time, isoburn_imgen_opts::vol_effective_time, isoburn_imgen_opts::vol_expiration_time, isoburn_imgen_opts::vol_modification_time, and isoburn_imgen_opts::vol_uuid.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_relaxed()

int isoburn_igopt_set_relaxed ( struct isoburn_imgen_opts o,
int  relax 
)

Definition at line 1283 of file isoburn.c.

1284 {
1285  o->omit_version_numbers= (!!(relax&1)) |
1286  (2 * !!(relax & isoburn_igopt_only_iso_versions));
1287  o->allow_deep_paths= !!(relax&2);
1288  o->allow_longer_paths= !!(relax&4);
1289  o->max_37_char_filenames= !!(relax&8);
1290  o->no_force_dots= (!!(relax&16)) |
1291  (2 * !!(relax & isoburn_igopt_no_j_force_dots));
1292  o->allow_lowercase= !!(relax&32);
1293  o->allow_full_ascii= !!(relax&64);
1294  o->joliet_longer_paths= !!(relax&128);
1295  o->always_gmt= !!(relax & isoburn_igopt_always_gmt);
1304  o->joliet_utf16= !!(relax & isoburn_igopt_joliet_utf16);
1305  return(1);
1306 }
#define isoburn_igopt_aaip_susp_1_10
Definition: libisoburn.h:1367
#define isoburn_igopt_iso1999_rec_mtime
Definition: libisoburn.h:1373
#define isoburn_igopt_joliet_long_names
Definition: libisoburn.h:1371
#define isoburn_igopt_no_j_force_dots
Definition: libisoburn.h:1369
#define isoburn_igopt_only_iso_versions
Definition: libisoburn.h:1368
#define isoburn_igopt_joliet_utf16
Definition: libisoburn.h:1375
#define isoburn_igopt_dir_rec_mtime
Definition: libisoburn.h:1366
#define isoburn_igopt_allow_dir_id_ext
Definition: libisoburn.h:1370
#define isoburn_igopt_joliet_rec_mtime
Definition: libisoburn.h:1372
#define isoburn_igopt_allow_7bit_ascii
Definition: libisoburn.h:1374
#define isoburn_igopt_always_gmt
Definition: libisoburn.h:1364
#define isoburn_igopt_rrip_version_1_10
Definition: libisoburn.h:1365

References isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_7bit_ascii, isoburn_imgen_opts::allow_deep_paths, isoburn_imgen_opts::allow_dir_id_ext, isoburn_imgen_opts::allow_full_ascii, isoburn_imgen_opts::allow_longer_paths, isoburn_imgen_opts::allow_lowercase, isoburn_imgen_opts::always_gmt, isoburn_imgen_opts::dir_rec_mtime, isoburn_imgen_opts::iso1999_rec_mtime, isoburn_igopt_aaip_susp_1_10, isoburn_igopt_allow_7bit_ascii, isoburn_igopt_allow_dir_id_ext, isoburn_igopt_always_gmt, isoburn_igopt_dir_rec_mtime, isoburn_igopt_iso1999_rec_mtime, isoburn_igopt_joliet_long_names, isoburn_igopt_joliet_rec_mtime, isoburn_igopt_joliet_utf16, isoburn_igopt_no_j_force_dots, isoburn_igopt_only_iso_versions, isoburn_igopt_rrip_version_1_10, isoburn_imgen_opts::joliet_long_names, isoburn_imgen_opts::joliet_longer_paths, isoburn_imgen_opts::joliet_rec_mtime, isoburn_imgen_opts::joliet_utf16, isoburn_imgen_opts::max_37_char_filenames, isoburn_imgen_opts::no_force_dots, isoburn_imgen_opts::omit_version_numbers, and isoburn_imgen_opts::rrip_version_1_10.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_rr_reloc()

int isoburn_igopt_set_rr_reloc ( struct isoburn_imgen_opts o,
char *  name,
int  flags 
)

If not isoburn_igopt_allow_deep_paths is in effect, then it may become necessary to relocate directories so that no ECMA-119 file path has more than 8 components.

These directories are grafted into either the root directory of the ISO image or into a dedicated relocation directory. For details see libisofs.h. Wrapper for: iso_write_opts_set_rr_reloc()

Since
1.2.2
Parameters
oThe option set to work on
nameThe name of the relocation directory in the root directory. Do not prepend "/". An empty name or NULL will direct relocated directories into the root directory. This is the default. If the given name does not exist in the root directory when isoburn_disc_write() is called, and if there are directories at path level 8, then directory /name will be created automatically.
flagsBitfield for control purposes. bit0= Mark the relocation directory by a Rock Ridge RE entry, if it gets created during isoburn_disc_write(). This will make it invisible for most Rock Ridge readers. bit1= not settable via API (used internally)
Returns
> 0 success, <= 0 failure

Definition at line 1329 of file isoburn.c.

1331 {
1332  if(o->rr_reloc_dir != name) {
1333  if(o->rr_reloc_dir != NULL)
1334  free(o->rr_reloc_dir);
1335  o->rr_reloc_dir= NULL;
1336  if(name != NULL) {
1337  o->rr_reloc_dir= strdup(name);
1338  if(o->rr_reloc_dir == NULL) {
1339  isoburn_msgs_submit(NULL, 0x00060000,
1340  "Cannot allocate memory for image generation options",
1341  0, "FATAL", 0);
1342  return(-1);
1343  }
1344  }
1345  }
1346  o->rr_reloc_flags = flags & 1;
1347  return 1;
1348 }

References isoburn_msgs_submit(), isoburn_imgen_opts::rr_reloc_dir, and isoburn_imgen_opts::rr_reloc_flags.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_scdbackup_tag()

int isoburn_igopt_set_scdbackup_tag ( struct isoburn_imgen_opts o,
char *  name,
char *  timestamp,
char *  tag_written 
)

Set or get parameters "name" and "timestamp" for a scdbackup checksum tag.

It will be appended to the libisofs session tag if the image starts at LBA 0. See isoburn_disc_track_lba_nwa. The scdbackup tag can be used to verify the image by command scdbackup_verify $device -auto_end. See scdbackup/README appendix VERIFY for its inner details.

Since
0.4.4
Parameters
oThe option set to work on
nameThe tag name. 80 characters max. An empty name disables production of an scdbackup tag.
timestampA string of up to 13 characters YYMMDD.hhmmss A9 = 2009, B0 = 2010, B1 = 2011, ... C0 = 2020, ...
tag_writtenEither NULL or the address of an array with at least 512 characters. In the latter case the eventually produced scdbackup tag will be copied to this array when the image gets written. This call sets scdbackup_tag_written[0] = 0 to mark its preliminary invalidity.
Returns
1 success, <=0 failure

Definition at line 1510 of file isoburn.c.

1512 {
1513  strncpy(o->scdbackup_tag_name, name, 80);
1514  o->scdbackup_tag_name[80]= 0;
1515  strncpy(o->scdbackup_tag_time, timestamp, 18);
1516  o->scdbackup_tag_time[18]= 0;
1517  o->scdbackup_tag_written = tag_written;
1518  if(tag_written != NULL)
1519  tag_written[0]= 0;
1520  return(1);
1521 }

References isoburn_imgen_opts::scdbackup_tag_name, isoburn_imgen_opts::scdbackup_tag_time, and isoburn_imgen_opts::scdbackup_tag_written.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_sort_files()

int isoburn_igopt_set_sort_files ( struct isoburn_imgen_opts o,
int  value 
)

Definition at line 1405 of file isoburn.c.

1406 {
1407  o->sort_files= !!(value&1);
1408  return(1);
1409 }

References isoburn_imgen_opts::sort_files.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_stdio_endsync()

int isoburn_igopt_set_stdio_endsync ( struct isoburn_imgen_opts opts,
int  do_sync 
)

Set or inquire whether a final fsync(2) is performed when updating the multi-session information of libburn stdio pseudo-drives by isoburn_activate_session().

Note: fsync(2) calls during and at the end of isoburn_disc_write() are controlled by libburn call burn_write_opts_set_stdio_fsync().

Since
1.2.4
Parameters
optsThe option set to be manipulated or inquired.
do_sync1= call fsync(2) with stdio drives in isoburn_activate_session() 0= do not
Returns
<=0 = error, 1 = success

Definition at line 2024 of file isoburn.c.

2026 {
2027  opts->do_fsync= !!do_sync;
2028  return(1);
2029 }

References isoburn_imgen_opts::do_fsync.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_system_area()

int isoburn_igopt_set_system_area ( struct isoburn_imgen_opts o,
char  data[32768],
int  options 
)

Attach 32 kB of binary data which shall get written to the first 32 kB of the ISO image, the System Area.

options can cause manipulations of these data before writing happens. If system area data are giveni or options bit0 is set, then bit1 of el_torito_set_isolinux_options() is automatically disabled.

Since
0.5.4
Parameters
oThe option set to work on
dataEither NULL or 32 kB of data. Do not submit less bytes !
optionsCan cause manipulations of submitted data before they get written: bit0= apply a –protective-msdos-label as of grub-mkisofs. This means to patch bytes 446 to 512 of the system area so that one partition is defined which begins at the second 512-byte block of the image and ends where the image ends. This works with and without system_area_data. bit1= apply isohybrid MBR patching to the system area. This works only with system area data from SYSLINUX plus an ISOLINUX boot image (see iso_image_set_boot_image()) and only if not bit0 is set. bit2-7= System area type 0= with bit0 or bit1: MBR else: unspecified type
Since
0.6.4 1= MIPS Big Endian Volume Header Submit up to 15 MIPS Big Endian boot files by iso_image_add_mips_boot_file() of libisofs. This will overwrite the first 512 bytes of 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.
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.
1.3.8 4= HP-PA PALO boot sector header version 4 Submit all five parameters of iso_image_set_hppa_palo() as non-NULL texts. 5= HP-PA PALO boot sector header version 5 Submit all five parameters of iso_image_set_hppa_palo() as non-NULL texts. bit8-9= Only with System area type 0 = MBR
1.0.4 Cylinder alignment mode eventually pads the image to make it end at a cylinder boundary. 0 = auto (align if bit1) 1 = always align to cylinder boundary 2 = never align to cylinder boundary bit10-13= System area sub type
1.2.4 With type 0 = MBR: Gets overridden by bit0 and bit1. 0 = no particular sub type 1 = CHRP: A single MBR partition of type 0x96 covers the ISO image. Not compatible with any other feature which needs to have own MBR partition entries. bit14= Only with System area type 0 = MBR GRUB2 boot provisions:
1.3.0 Patch system area at byte 0x1b0 to 0x1b7 with (512-block address + 4) of the first boot image file. Little-endian 8-byte. Should be combined with options bit0. Will not be in effect if options bit1 is set.
Returns
1 success, 0 no data to get, <0 failure

Definition at line 1537 of file isoburn.c.

1539 {
1540  if (data == NULL) { /* Disable */
1541  if (opts->system_area_data != NULL)
1542  free(opts->system_area_data);
1543  opts->system_area_data = NULL;
1544  } else {
1545  if (opts->system_area_data == NULL) {
1546  opts->system_area_data = calloc(32768, 1);
1547  if (opts->system_area_data == NULL)
1548  return(-1);
1549  }
1550  memcpy(opts->system_area_data, data, 32768);
1551  }
1552  opts->system_area_options = options & 0xffff;
1553  return(1);
1554 }

References isoburn_imgen_opts::system_area_data, and isoburn_imgen_opts::system_area_options.

Referenced by Xorriso_set_system_area().

◆ isoburn_igopt_set_tail_blocks()

int isoburn_igopt_set_tail_blocks ( struct isoburn_imgen_opts opts,
uint32_t  num_blocks 
)

Set or get the number of trailing zero byte blocks to be written by libisofs.

The image size counter of the emerging ISO image will include them. Eventual checksums will take them into respect. They will be written immediately before the eventual image checksum area which is at the very end of the image. For a motivation see iso_write_opts_set_tail_blocks() in libisofs.h .

Since
0.6.4
Parameters
optsThe option set to work on
num_blocksNumber of extra 2 kB blocks to be written by libisofs.
Returns
1 success, <=0 failure

Definition at line 1639 of file isoburn.c.

1641 {
1642  opts->tail_blocks = num_blocks;
1643  return 1;
1644 }

References isoburn_imgen_opts::tail_blocks.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_igopt_set_untranslated_name_len()

int isoburn_igopt_set_untranslated_name_len ( struct isoburn_imgen_opts o,
int  len 
)

Caution: This option breaks any assumptions about names that are supported by ECMA-119 specifications.

Try to omit any translation which would make a file name compliant to the ECMA-119 rules. This includes and exceeds omit_version_numbers, max_37_char_filenames, no_force_dots bit0, allow_full_ascii. Further it prevents the conversion from local character set to ASCII. The maximum name length is given by this call. If a filename exceeds this length or cannot be recorded untranslated for other reasons, then image production gets aborted. Currently the length limit is 96 characters, because an ECMA-119 directory record may at most have 254 bytes and up to 158 other bytes must fit into the record. Probably 96 more bytes can be made free for the name in future.

Since
1.0.0
Parameters
oThe option set to work on
len0 = disable this feature and perform name translation according to other settings. >0 = Omit any translation. Eventually abort image production if a name is longer than the given value. -1 = Like >0. Allow maximum possible length. isoburn_igopt_get_untranslated_name_len() will tell the effectively resulting value.
Returns
>0 success, <=0 failure

Definition at line 1360 of file isoburn.c.

1362 {
1363  int ret;
1364  IsoWriteOpts *opts = NULL;
1365  char *msg= NULL;
1366 
1367  msg= calloc(1, 160);
1368  if(msg == NULL)
1369  {ret= -1; goto ex;}
1370 
1371  ret= iso_write_opts_new(&opts, 0);
1372  if(ret < 0) {
1373  isoburn_msgs_submit(NULL, 0x00060000,
1374  "Cannot create libisofs write options object", 0, "FATAL", 0);
1375  {ret= 0; goto ex;}
1376  }
1377  ret= iso_write_opts_set_untranslated_name_len(opts, len);
1378  if(ret < 0) {
1379  ret= iso_write_opts_set_untranslated_name_len(opts, -1);
1380  sprintf(msg,
1381  "Improper value for maximum length of untranslated names (%d <-> -1 ... %d)",
1382  len, ret);
1383  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
1384  iso_write_opts_free(opts);
1385  {ret= 0; goto ex;}
1386  }
1387  o->untranslated_name_len= ret; /* Normalized len value */
1388  iso_write_opts_free(opts);
1389  ret= 1;
1390 ex:;
1391  if(msg != NULL)
1392  free(msg);
1393  return(ret);
1394 }

References isoburn_msgs_submit(), and isoburn_imgen_opts::untranslated_name_len.

Referenced by Xorriso_make_iso_write_opts(), and Xorriso_relax_compliance().

◆ isoburn_igopt_set_write_type()

int isoburn_igopt_set_write_type ( struct isoburn_imgen_opts opts,
int  do_tao 
)

Set or inquire the write type for the next write run on optical media.

Since
1.2.4
Parameters
optsThe option set to be manipulated or inquired.
do_taoThe value to be set or the variable where to return the current setting: 0 = Let libburn choose according to other write parameters. This is advisable unless there are particular reasons not to use one of the two write types. Be aware that 1 and -1 can lead to failure if the write type is not appropriate for the given media situation. 1 = Use BURN_WRITE_TAO which does TAO on CD, Incremental on DVD-R, no track reservation on DVD+R and BD-R -1 = Use BURN_WRITE_SAO which does SAO on CD, DAO on DVD-R, track reservation on DVD+R and BD-R
Returns
<=0 = error, 1 = success

Definition at line 2009 of file isoburn.c.

2010 {
2011  if(do_tao < -1 || do_tao > 1)
2012  return(0);
2013  opts->do_tao= do_tao;
2014  return(1);
2015 }

References isoburn_imgen_opts::do_tao.

Referenced by Xorriso_make_iso_write_opts().

◆ isoburn_initialize()

int isoburn_initialize ( char  msg[1024],
int  flag 
)

Overview.

libisoburn is a frontend for libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported by libburn. This includes media like DVD+RW, which do not support multi-session management on media level and even plain disk files or block devices.

The price for that is thorough specialization on data files in ISO-9660 filesystem images. So libisoburn is not suitable for audio (CD-DA) or any other CD layout which does not entirely consist of ISO-9660 sessions.

Note that there is a higher level of API: xorriso.h. One should not mix it with the API calls of libisoburn.h, libisofs.h, and libburn.h.

                      Connector functions

libisofs and libburn do not depend on each other but share some interfaces by which they can cooperate. libisoburn establishes the connection between both modules by creating the necessary interface objects and attaching them to the right places.

                      Wrapper functions 

The principle of this frontend is that you may use any call of libisofs or libburn unless it has a isoburn_*() wrapper listed in the following function documentation.

E.g. call isoburn_initialize() rather than iso_init(); burn_initialize(); and call isoburn_drive_scan_and_grab() rather than burn_drive_scan_and_grab(). But you may call burn_disc_get_profile() directly if you want to display the media type.

The wrappers will transparently provide the necessary emulations which are appropriate for particular target drives and media states. To learn about them you have to read both API descriptions: the one of the wrapper and the one of the underlying libburn or libisofs call.

Macros BURN_* and functions burn_*() are documented in <libburn/libburn.h> Macros ISO_* and functions iso_*() are documented in <libisofs/libisofs.h>

                         Usage model

There may be an input drive and an output drive. Either of them may be missing with the consequence that no reading or no writing is possible. Both drive roles can be fulfilled by the same drive.

Input can be a random access readable libburn drive: optical media, regular files, block devices. Output can be any writeable libburn drive: writeable optical media in burner, writeable file objects (no directories).

libburn demands rw-permissions to drive device file or file object.

If the input drive provides a suitable ISO RockRidge image, then its tree may be loaded into memory and can then be manipulated by libisofs API calls. The loading is done by isoburn_read_image() under control of struct isoburn_read_opts which the application obtains from libisoburn and manipulates by the family of isoburn_ropt_set_*() functions.

Writing of result images is controlled by libisofs related parameters in a struct isoburn_imgen_opts which the application obtains from libisoburn and manipulates by the family of isoburn_igopt_set_*() functions.

All multi-session aspects are handled by libisoburn according to these settings. The application does not have to analyze media state and write job parameters. It rather states its desires which libisoburn tries to fulfill, or else will refuse to start the write run.

          Setup for Growing, Modifying or Blind Growing

The connector function family offers alternative API calls for performing the setup for several alternative image generation strategies.

Growing: If input and output drive are the same, then isoburn_prepare_disc() is to be used. It will lead to an add-on session on appendable or overwritable media with existing ISO image. With blank media it will produce a first session.

Modifying: If the output drive is not the input drive, and if it bears blank media or overwritable without a valid ISO image, then one may produce a consolidated image with old and new data. This will copy file data from an eventual input drive with valid image, add any newly introduced data from the local filesystem, and produce a first session on output media. To prepare for such an image generation run, use isoburn_prepare_new_image().

Blind Growing: This method reads the old image from one drive and writes the add-on session to a different drive. That output drive is nevertheless supposed to finally lead to the same medium from where the session was loaded. Usually it will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program like with this classic gesture: mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev Blind growing is prepared by the call isoburn_prepare_blind_grow(). The input drive should be released immediately after this call in order to allow the consumer of the output stream to access that drive for writing.

After either of these setups, some peripheral libburn drive parameter settings like burn_write_opts_set_simulate(), burn_write_opts_set_multi(), burn_drive_set_speed(), burn_write_opts_set_underrun_proof() should be made. Do not set the write mode. It will be chosen by libisoburn so it matches job and media state.

                       Writing the image

Then one may start image generation and write threads by isoburn_disc_write(). Progress may be watched at the output drive by burn_drive_get_status() and isoburn_get_fifo_status().

At some time, the output drive will be BURN_DRIVE_IDLE indicating that writing has ended. One should inquire isoburn_drive_wrote_well() to learn about overall success.

Finally one must call isoburn_activate_session() which will complete any eventual multi-session emulation.

                     Application Constraints

Applications shall include libisofs/libisofs.h , libburn/libburn.h and this file itself: libisoburn/libisoburn.h . They shall link with -lisofs -lburn -lisoburn or with the .o files emerging from building those libraries from their sources.

Applications must use 64 bit off_t. E.g. on 32-bit GNU/Linux by defining #define _LARGEFILE_SOURCE #define _FILE_OFFSET_BITS 64 The minimum requirement is to interface with the library by 64 bit signed integers where libisofs.h or libisoburn.h prescribe off_t. Failure to do so may result in surprising malfunction or memory faults.

Application files which include libisofs/libisofs.h or libisoburn/libisoburn.h must provide definitions for uint32_t and uint8_t. This can be achieved either:

  • by using autotools which will define HAVE_STDINT_H or HAVE_INTTYPES_H according to its ./configure tests,
  • or by defining the macros HAVE_STDINT_H or HAVE_INTTYPES_H according to the local situation,
  • or by appropriately defining uint32_t and uint8_t by other means, e.g. by including inttypes.h before including libisofs.h and libisoburn.h Initialize libisoburn, libisofs and libburn. Wrapper for : iso_init() and burn_initialize()
    Since
    0.1.0
    Parameters
    msgA character array for eventual messages (e.g. with errors)
    flagBitfield for control purposes (unused yet, submit 0)
    Returns
    1 indicates success, 0 is failure

Definition at line 74 of file burn_wrap.c.

75 {
76  int major, minor, micro, bad_match= 0, no_iso_init= 0;
77 
78 
79 /* First the ugly compile time checks for header version compatibility.
80  If everything matches, then they produce no C code. In case of mismatch,
81  intentionally faulty C code will be inserted.
82 */
83 
84 #ifdef iso_lib_header_version_major
85 /* The minimum requirement of libisoburn towards the libisofs header
86  at compile time is defined in libisoburn/libisoburn.h :
87  isoburn_libisofs_req_major
88  isoburn_libisofs_req_minor
89  isoburn_libisofs_req_micro
90  It gets compared against the version macros in libisofs/libisofs.h :
91  iso_lib_header_version_major
92  iso_lib_header_version_minor
93  iso_lib_header_version_micro
94  If the header is too old then the following code shall cause failure of
95  libisoburn compilation rather than to allow production of a program with
96  unpredictable bugs or memory corruption.
97  The compiler messages supposed to appear in this case are:
98  error: 'LIBISOFS_MISCONFIGURATION' undeclared (first use in this function)
99  error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_AND_burn_wrap_dot_h' undeclared (first use in this function)
100  error: 'LIBISOFS_MISCONFIGURATION_' undeclared (first use in this function)
101 */
102 /* The indentation is an advise of man gcc to help old compilers ignoring */
103  #if isoburn_libisofs_req_major > iso_lib_header_version_major
104  #define Isoburn_libisofs_dot_h_too_olD 1
105  #endif
106  #if isoburn_libisofs_req_major == iso_lib_header_version_major && isoburn_libisofs_req_minor > iso_lib_header_version_minor
107  #define Isoburn_libisofs_dot_h_too_olD 1
108  #endif
109  #if isoburn_libisofs_req_minor == iso_lib_header_version_minor && isoburn_libisofs_req_micro > iso_lib_header_version_micro
110  #define Isoburn_libisofs_dot_h_too_olD 1
111  #endif
112 
113 #ifdef Isoburn_libisofs_dot_h_too_olD
114 LIBISOFS_MISCONFIGURATION = 0;
115 INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_AND_burn_wrap_dot_c = 0;
116 LIBISOFS_MISCONFIGURATION_ = 0;
117 #endif
118 
119 #endif /* iso_lib_header_version_major */
120 
121 /* The minimum requirement of libisoburn towards the libburn header
122  at compile time is defined in libisoburn/libisoburn.h :
123  isoburn_libburn_req_major
124  isoburn_libburn_req_minor
125  isoburn_libburn_req_micro
126  It gets compared against the version macros in libburn/libburn.h :
127  burn_header_version_major
128  burn_header_version_minor
129  burn_header_version_micro
130  If the header is too old then the following code shall cause failure of
131  cdrskin compilation rather than to allow production of a program with
132  unpredictable bugs or memory corruption.
133  The compiler messages supposed to appear in this case are:
134  error: 'LIBBURN_MISCONFIGURATION' undeclared (first use in this function)
135  error: 'INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h' undeclared (first use in this function)
136  error: 'LIBBURN_MISCONFIGURATION_' undeclared (first use in this function)
137 */
138 
139 /* The indentation is an advise of man gcc to help old compilers ignoring */
140  #if isoburn_libburn_req_major > burn_header_version_major
141  #define Isoburn_libburn_dot_h_too_olD 1
142  #endif
143  #if isoburn_libburn_req_major == burn_header_version_major && isoburn_libburn_req_minor > burn_header_version_minor
144  #define Isoburn_libburn_dot_h_too_olD 1
145  #endif
146  #if isoburn_libburn_req_minor == burn_header_version_minor && isoburn_libburn_req_micro > burn_header_version_micro
147  #define Isoburn_libburn_dot_h_too_olD 1
148  #endif
149 
150 #ifdef Isoburn_libburn_dot_h_too_olD
151 LIBBURN_MISCONFIGURATION = 0;
152 INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h = 0;
153 LIBBURN_MISCONFIGURATION_ = 0;
154 #endif
155 
156 
157 #ifdef Xorriso_with_libjtE
158 
159 /* The minimum requirement of libisoburn towards the libjte header
160  at compile time is the same as the one of a usable libisofs towards libjte.
161  So the requirement is defined in libisofs/libisofs.h :
162  iso_libjte_req_major , iso_libjte_req_minor , iso_libjte_req_micro
163 */
164  /* The indentation is an advise of man gcc to help old compilers ignoring */
165  #if iso_libjte_req_major > LIBJTE_VERSION_MAJOR
166  #define Libisofs_libjte_dot_h_too_olD 1
167  #endif
168  #if iso_libjte_req_major == LIBJTE_VERSION_MAJOR && iso_libjte_req_minor > LIBJTE_VERSION_MINOR
169  #define Libisofs_libjte_dot_h_too_olD 1
170  #endif
171  #if iso_libjte_req_minor == LIBJTE_VERSION_MINOR && iso_libjte_req_micro > LIBJTE_VERSION_MICRO
172  #define Libisofs_libjte_dot_h_too_olD 1
173  #endif
174 
175 #ifdef Libisofs_libjte_dot_h_too_olD
176 LIBJTE_MISCONFIGURATION = 0;
177 INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libjte_dot_h_TOO_OLD__SEE_libisofs_dot_h_AND_burn_wrap.c_c = 0;
178 LIBJTE_MISCONFIGURATION_ = 0;
179 #endif
180 
181 #endif /* Xorriso_with_libjtE */
182 
183 
184 /* End of ugly compile time tests (scroll up for explanation) */
185 
186 
187  msg[0]= 0;
188 
189 #ifdef Xorriso_with_libjtE
190 
191  libjte__version(&major, &minor, &micro);
192  sprintf(msg + strlen(msg), "libjte-%d.%d.%d ", major, minor, micro);
193  if (libjte__is_compatible(LIBJTE_VERSION_MAJOR, LIBJTE_VERSION_MINOR,
194  LIBJTE_VERSION_MICRO, 0)) {
195  sprintf(msg+strlen(msg), "ok, ");
196  } else {
197  sprintf(msg + strlen(msg),
198  "- TOO OLD -, need at least libjte-%d.%d.%d ,\n",
199  LIBJTE_VERSION_MAJOR, LIBJTE_VERSION_MINOR,
200  LIBJTE_VERSION_MICRO);
201  bad_match= 1;
202  no_iso_init= 1; /* iso_init() will fail anyway */
203  }
204 
205 #endif /* Xorriso_with_libjtE */
206 
207  if(!no_iso_init) {
208  if(iso_init()<0) {
209  sprintf(msg+strlen(msg), "Cannot initialize libisofs\n");
210  return(0);
211  }
212  }
213  iso_lib_version(&major, &minor, &micro);
214  sprintf(msg+strlen(msg), "libisofs-%d.%d.%d ", major, minor, micro);
215 #ifdef iso_lib_header_version_major
216  if(iso_lib_is_compatible(iso_lib_header_version_major,
217  iso_lib_header_version_minor,
218  iso_lib_header_version_micro)) {
219  sprintf(msg+strlen(msg), "ok, ");
220  } else {
221  sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n",
222  iso_lib_header_version_major, iso_lib_header_version_minor,
223  iso_lib_header_version_micro);
224  bad_match= 1;
225  }
226 #else
227  if(iso_lib_is_compatible(isoburn_libisofs_req_major,
230  sprintf(msg+strlen(msg), "suspicious, ");
231  } else {
232  sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n",
235  bad_match= 1;
236  }
237 #endif /* ! iso_lib_header_version_major */
238 
239  if(!burn_initialize()) {
240  sprintf(msg+strlen(msg), "Cannot initialize libburn\n");
241  return(0);
242  }
243 
244  burn_version(&major, &minor, &micro);
245  sprintf(msg+strlen(msg), "libburn-%d.%d.%d ", major, minor, micro);
246  if(major > burn_header_version_major
247  || (major == burn_header_version_major
248  && (minor > burn_header_version_minor
249  || (minor == burn_header_version_minor
250  && micro >= burn_header_version_micro)))) {
251  sprintf(msg+strlen(msg), "ok, ");
252  } else {
253  sprintf(msg+strlen(msg), "- TOO OLD -, need at least libburn-%d.%d.%d ,\n",
254  burn_header_version_major, burn_header_version_minor,
255  burn_header_version_micro);
256  bad_match= 1;
257  }
258 
259  isoburn_version(&major, &minor, &micro);
260  sprintf(msg+strlen(msg), "for libisoburn-%d.%d.%d", major, minor, micro);
261  if(bad_match)
262  return(0);
263 
264  isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */
265  return(1);
266 }
void isoburn_version(int *major, int *minor, int *micro)
Obtain the three release version numbers of the library.
Definition: isoburn.c:808
#define isoburn_libisofs_req_major
The minimum version of libisofs to be used with this version of libisoburn at compile time.
Definition: libisoburn.h:250
#define isoburn_libisofs_req_minor
Definition: libisoburn.h:251
#define isoburn_libisofs_req_micro
Definition: libisoburn.h:252

References isoburn_destroy_all(), isoburn_libisofs_req_major, isoburn_libisofs_req_micro, isoburn_libisofs_req_minor, isoburn_list_start, and isoburn_version().

Referenced by Xorriso_startup_libraries().

◆ isoburn_is_compatible()

int isoburn_is_compatible ( int  major,
int  minor,
int  micro,
int  flag 
)

Check whether all features of header file libisoburn.h from the given major.minor.micro revision triple can be delivered by the library version which is performing this call.

An application of libisoburn can easily memorize the version of the libisoburn.h header in its own code. Immediately after isoburn_initialize() it should simply do this check: if (! isoburn_is_compatible(isoburn_header_version_major, isoburn_header_version_minor, isoburn_header_version_micro, 0)) ...refuse to start the program with this dynamic library version...

Since
0.1.0
Parameters
majorobtained at build time
minorobtained at build time
microobtained at build time
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
1= library can work for caller 0= library is not usable in some aspects. Caller must restrict itself to an earlier API version or must not use this library at all.

Definition at line 824 of file isoburn.c.

825 {
826  int own_major, own_minor, own_micro;
827 
828  isoburn_version(&own_major, &own_minor, &own_micro);
829  return(own_major > major ||
830  (own_major == major && (own_minor > minor ||
831  (own_minor == minor && own_micro >= micro))));
832 }

References isoburn_version().

Referenced by Xorriso_startup_libraries().

◆ isoburn_libburn_req()

int isoburn_libburn_req ( int *  major,
int *  minor,
int *  micro 
)

The minimum version of libburn to be used with this version of libisoburn at runtime.

This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only.

Since
0.1.0
Parameters
majorisoburn_libburn_req_major as seen at build time
minoras seen at build time
microas seen at build time
Returns
1 success, <=0 might in future become an error indication

Definition at line 280 of file burn_wrap.c.

281 {
282  *major= burn_header_version_major;
283  *minor= burn_header_version_minor;
284  *micro= burn_header_version_micro;
285  return(1);
286 }

Referenced by Xorriso_report_lib_versions().

◆ isoburn_libisofs_req()

int isoburn_libisofs_req ( int *  major,
int *  minor,
int *  micro 
)

The minimum compile time requirements of libisoburn towards libjte are the same as of a suitable libisofs towards libjte.

So use these macros from libisofs.h : iso_libjte_req_major iso_libjte_req_minor iso_libjte_req_micro

Since
0.6.4 The minimum version of libisofs to be used with this version of libisoburn at runtime. This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only.
0.1.0
Parameters
majorisoburn_libisofs_req_major as seen at build time
minoras seen at build time
microas seen at build time
Returns
1 success, <=0 might in future become an error indication

Definition at line 270 of file burn_wrap.c.

271 {
272  *major= iso_lib_header_version_major;
273  *minor= iso_lib_header_version_minor;
274  *micro= iso_lib_header_version_micro;
275  return(1);
276 }

Referenced by Xorriso_report_lib_versions().

◆ isoburn_libjte_req()

int isoburn_libjte_req ( int *  major,
int *  minor,
int *  micro 
)

The minimum version of libjte to be used with this version of libisoburn at runtime.

The use of libjte is optional and depends on configure tests. It can be prevented by ./configure option –disable-libjte . This is checked already in isoburn_initialize() which will refuse on outdated version. So this call is for information purposes after successful startup only.

Since
0.6.4

Definition at line 290 of file burn_wrap.c.

291 {
292 #ifdef Xorriso_with_libjtE
293  *major= LIBJTE_VERSION_MAJOR;
294  *minor= LIBJTE_VERSION_MINOR;
295  *micro= LIBJTE_VERSION_MICRO;
296 #else
297  *major= *minor= *micro= 0;
298 #endif /* ! Xorriso_with_libjtE */
299  return(1);
300 }

Referenced by Xorriso_report_lib_versions().

◆ isoburn_needs_emulation()

int isoburn_needs_emulation ( struct burn_drive *  d)

Inquire whether the medium needs emulation or would be suitable for generic multi-session via libburn.

Since
0.1.0
Parameters
dThe drive to inquire
Returns
0 is generic multi-session 1 is emulated multi-session -1 is not suitable for isoburn

Definition at line 1062 of file burn_wrap.c.

1063 {
1064  int ret;
1065  struct isoburn *o;
1066  enum burn_disc_status s;
1067 
1069  if(s!=BURN_DISC_BLANK && s!=BURN_DISC_APPENDABLE)
1070  return(-1);
1071  ret= isoburn_find_emulator(&o, drive, 0);
1072  if(ret<0)
1073  return(-1);
1074  if(ret>0)
1075  if(o->emulation_mode>0)
1076  return(1);
1077  return(0);
1078 }

References isoburn::drive, isoburn::emulation_mode, isoburn_disc_get_status(), and isoburn_find_emulator().

Referenced by Xorriso_burn_track(), and Xorriso_sanitize_image_size().

◆ isoburn_prepare_blind_grow()

int isoburn_prepare_blind_grow ( struct burn_drive *  in_drive,
struct burn_disc **  disc,
struct isoburn_imgen_opts opts,
struct burn_drive *  out_drive,
int  nwa 
)

Start production of an ISO 9660 image using the method of Blind Growing: Create a disc object for writing an add-on session from the created or loaded IsoImage which has been manipulated via libisofs, to a different drive than the one from where it was loaded.

Usually output will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program like with this classic gesture: mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev Parameter translation into libisoburn: $dev is the address by which parameter in_drive of this call was acquired $msc1 was set by isoburn_set_msc1() before image reading or was detected from the in_drive medium $nwa is a parameter of this call or can be used as detected from the in_drive medium

This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. This call waits for libisofs output to become available and then detaches the input drive object from the data source object by which libisofs was reading from the input drive. So, as far as libisofs is concerned, that drive may be released immediately after this call in order to allow the consumer to access the drive for writing. The consumer should wait for input to become available and only then open its burn drive. With cdrecord this is caused by option -waiti.

The resulting burn_disc object has to be disposed when all its writing is done and the drive is BURN_DRIVE_IDLE again after asynchronous burn_disc_write().

Since
0.2.2
Parameters
in_driveThe input drive,grabbed with isoburn_drive_scan_and_grab().
discReturns the newly created burn_disc object.
optsOptions for image generation and data transport to media.
out_driveThe output drive, from isoburn_drive_aquire() et.al.. typically stdio:/dev/fd/1 .
nwaThe address (2048 byte block count) where the add-on session will be finally stored on a mountable medium or in a mountable file. If nwa is -1 then the address is used as determined from the in_drive medium.
Returns
<=0 error , 1 = success

Definition at line 739 of file isoburn.c.

742 {
743  int ret;
744  struct isoburn *o= NULL;
745 
746  ret= isoburn_find_emulator(&o, out_drive, 0);
747  if(ret<0 || o==NULL)
748  return(-1);
749  if(nwa >= 0)
750  o->fabricated_msc2= nwa;
751  if(o->nwa == o->zero_nwa)
752  o->nwa= o->zero_nwa= 0;
753  else
754  o->zero_nwa= 0;
755  o->min_start_byte= 0;
756  ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 2);
757  if (ret<=0)
758  return ret;
759  return(1);
760 }
static int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d, struct burn_disc **disc, struct isoburn_imgen_opts *opts, int flag)
Definition: isoburn.c:580

References isoburn::fabricated_msc2, isoburn_find_emulator(), isoburn_prepare_disc_aux(), isoburn::min_start_byte, isoburn::nwa, and isoburn::zero_nwa.

Referenced by Xorriso_write_session().

◆ isoburn_prepare_disc()

int isoburn_prepare_disc ( struct burn_drive *  drive,
struct burn_disc **  disc,
struct isoburn_imgen_opts opts 
)

Start production of an ISO 9660 image using the method of Growing: Create a disc object for writing the new session from the created or loaded iso_volset which has been manipulated via libisofs, to the same medium from where the image was eventually loaded.

This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. The returned struct burn_disc is ready for use by a subsequent call to isoburn_disc_write(). After this asynchronous writing has ended and the drive is BURN_DRIVE_IDLE again, the burn_disc object has to be disposed by burn_disc_free().

Since
0.1.0
Parameters
driveThe combined source and target drive, grabbed with isoburn_drive_scan_and_grab(). .
discReturns the newly created burn_disc object.
optsImage generation options, see isoburn_igopt_*()
Returns
<=0 error , 1 = success

Definition at line 718 of file isoburn.c.

720 {
721  return isoburn_prepare_disc_aux(d, d, disc, opts, 0);
722 }

References isoburn_prepare_disc_aux().

Referenced by Xorriso_write_session().

◆ isoburn_prepare_new_image()

int isoburn_prepare_new_image ( struct burn_drive *  in_drive,
struct burn_disc **  disc,
struct isoburn_imgen_opts opts,
struct burn_drive *  out_drive 
)

Start production of an ISO 9660 image using the method of Modifying: Create a disc object for producing a new image from a previous image plus the changes made by user.

The generated burn_disc is suitable to be written to a grabbed drive with blank writeable medium. But you must not use the same drive for input and output, because data will be read from the source drive while at the same time the target drive is already writing. This call starts a libisofs thread which begins to produce the image. It has to be revoked by isoburn_cancel_prepared_write() if for some reason this image data stream shall not be consumed. The resulting burn_disc object has to be disposed when all its writing is done and the drive is BURN_DRIVE_IDLE again after asynchronous burn_disc_write().

Since
0.1.0
Parameters
in_driveThe input drive, grabbed with isoburn_drive_aquire() or one of its alternatives.
discReturns the newly created burn_disc object.
optsOptions for image generation and data transport to the medium.
out_driveThe output drive, from isoburn_drive_aquire() et.al..
Returns
<=0 error , 1 = success

Definition at line 725 of file isoburn.c.

728 {
729  int ret;
730 
731  ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 1);
732  if (ret<=0)
733  return ret;
734  return 1;
735 }

References isoburn_prepare_disc_aux().

Referenced by Xorriso_write_session().

◆ isoburn_read_image()

int isoburn_read_image ( struct burn_drive *  d,
struct isoburn_read_opts read_opts,
IsoImage **  image 
)

Load the ISO filesystem directory tree from the medium in the given drive.

This will give libisoburn the base on which it can let libisofs perform image growing or image modification. The loaded volset gets attached to the drive object and handed out to the application. Not a wrapper, but peculiar to libisoburn.

Since
0.1.0
Parameters
dThe drive which holds an existing ISO filesystem or blank media. d is allowed to be NULL which produces an empty ISO image. In this case one has to call before writing isoburn_attach_volset() with the volset from this call and with the intended output drive.
read_optsThe read options which can be chosen by the application
imagethe image read, if the disc is blank it will have no files. This reference needs to be released via iso_image_unref() when it is not longer needed. The drive, if not NULL, will hold an own reference which it will release when it gets a new volset or when it gets released via isoburn_drive_release(). You can pass NULL if you already have a reference or you plan to obtain it later with isoburn_get_attached_image(). Of course, if you haven't specified a valid drive (i.e., if d == NULL), this parameter can't be NULL.
Returns
<=0 error , 1 = success

Definition at line 142 of file isofs_wrap.c.

145 {
146  int ret, int_num, dummy, ignore_aclea= 0;
147  IsoReadOpts *ropts= NULL;
148  IsoReadImageFeatures *features= NULL;
149  uint32_t ms_block;
150  char *msg= NULL;
151  enum burn_disc_status status= BURN_DISC_BLANK;
152  IsoDataSource *ds= NULL;
153  struct isoburn *o= NULL;
154  IsoImage *new_image= NULL;
155 
156  msg= calloc(1, 160);
157 
158  if(d != NULL) {
159  ret = isoburn_find_emulator(&o, d, 0);
160  if (ret < 0 || o == NULL)
161  {ret= 0; goto ex;}
162  status = isoburn_disc_get_status(d);
163  o->image_start_lba= -1;
164  }
165  if(read_opts==NULL) {
166  isoburn_msgs_submit(o, 0x00060000,
167  "Program error: isoburn_read_image: read_opts==NULL",
168  0, "FATAL", 0);
169  {ret= -1; goto ex;}
170  }
171  if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) {
172 create_blank_image:;
173  /*
174  * Blank disc, we create a new image without files.
175  */
176 
177  if (d == NULL) {
178  /* New empty image without relation to a drive */
179  if (image==NULL) {
180  isoburn_msgs_submit(o, 0x00060000,
181  "Program error: isoburn_read_image: image==NULL",
182  0, "FATAL", 0);
183  {ret= -1; goto ex;}
184  }
185  /* create a new image */
186  ret = iso_image_new("ISOIMAGE", image);
187  if (ret < 0) {
188  isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
189  goto ex;
190  }
191  new_image= *image;
192  } else {
193  /* Blank new image for the drive */
194  if(o->image != NULL)
195  ignore_aclea= iso_image_get_ignore_aclea(o->image);
196  iso_image_unref(o->image);
197  ret = iso_image_new("ISOIMAGE", &o->image);
198  if (ret < 0) {
199  isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
200  goto ex;
201  }
202  if (image != NULL) {
203  *image = o->image;
204  iso_image_ref(*image); /*protects object from premature free*/
205  }
206  iso_image_set_ignore_aclea(o->image, ignore_aclea);
207  ret= isoburn_root_defaults(o->image, 0);
208  if(ret <= 0)
209  goto ex;
210  new_image= o->image;
211  }
212  ret= iso_image_set_truncate_mode(new_image, read_opts->truncate_mode,
213  read_opts->truncate_length);
214  if(ret < 0)
215  goto ex;
216  {ret= 1; goto ex;}
217  }
218 
219  if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) {
220  isoburn_msgs_submit(o, 0x00060000,
221  "Program error: isoburn_read_image: incorrect disc status",
222  0, "FATAL", 0);
223  {ret= -4; goto ex;}
224  }
225 
226  ret = isoburn_disc_get_msc1(d, &int_num);
227  if (ret <= 0)
228  {ret= -2; goto ex;}
229  ms_block= int_num;
230  if (o != NULL)
231  o->image_start_lba= ms_block;
232  ret = isoburn_read_iso_head(d, int_num, &dummy, NULL, 0);
233  if (ret <= 0) {
234  sprintf(msg, "No ISO 9660 image at LBA %d. Creating blank image.", int_num);
235  isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
236  goto create_blank_image;
237  }
238 
239  if(read_opts->displacement != 0 && abs(read_opts->displacement_sign) == 1) {
240  /* Apply reverse displacement to session start */
241  if(read_opts->displacement_sign == -1) {
242  if(ms_block+ read_opts->displacement < ms_block) {
243 displacement_rollover:;
244  sprintf(msg, "Displacement offset leads outside 32 bit range.");
245  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
246  {ret= 0; goto ex;}
247  }
248  ms_block+= read_opts->displacement;
249  } else {
250  if(ms_block < read_opts->displacement)
251  goto displacement_rollover;
252  ms_block-= read_opts->displacement;
253  }
254  }
255 
256 
257  /* create the data source */
258  ret = iso_read_opts_new(&ropts, 0);
259  if (ret < 0) {
260  isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
261  goto ex;
262  }
263 
264  /* Important: do not return until iso_read_opts_free() */
265 
266  iso_read_opts_set_start_block(ropts, ms_block);
267  iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
268  iso_read_opts_set_no_aaip(ropts, read_opts->noaaip);
269  if(read_opts->nomd5 == 2)
270  int_num= 2;
271  else if(read_opts->nomd5 == 1)
272  int_num= 1;
273  else
274  int_num= 0;
275  iso_read_opts_set_no_md5(ropts, int_num);
276  if(read_opts->do_ecma119_map)
277  iso_read_opts_set_ecma119_map(ropts, read_opts->map_mode);
278  if(read_opts->do_joliet_map)
279  iso_read_opts_set_joliet_map(ropts, read_opts->joliet_map_mode);
280  iso_read_opts_set_new_inos(ropts, read_opts->noino);
281 
282  iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet);
283  iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999);
284  iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet);
285  iso_read_opts_set_default_permissions(ropts,
286  read_opts->mode, read_opts->dirmode);
287  iso_read_opts_set_default_uid(ropts, read_opts->uid);
288  iso_read_opts_set_default_gid(ropts, read_opts->gid);
289  iso_read_opts_set_input_charset(ropts, read_opts->input_charset);
290  iso_read_opts_auto_input_charset(ropts, read_opts->auto_input_charset);
291  iso_read_opts_load_system_area(ropts, 1);
292  iso_read_opts_keep_import_src(ropts, 1);
293  ret= iso_image_set_truncate_mode(o->image, read_opts->truncate_mode,
294  read_opts->truncate_length);
295  if(ret < 0)
296  goto ex;
297 
298  ds = isoburn_data_source_new(d, read_opts->displacement,
299  read_opts->displacement_sign,
300  read_opts->cache_tiles, read_opts->cache_tile_blocks);
301  if (ds == NULL) {
302  isoburn_report_iso_error(ret, "Cannot create IsoDataSource object", 0,
303  "FATAL", 0);
304  ret= -1; goto ex;
305  }
306  if(o->iso_data_source!=NULL)
307  iso_data_source_unref(o->iso_data_source);
308  o->iso_data_source= ds;
309  iso_image_attach_data(o->image, o->read_pacifier_handle,
311  if(o->read_pacifier_handle==NULL)
312  iso_tree_set_report_callback(o->image, NULL);
313  else
314  iso_tree_set_report_callback(o->image, o->read_pacifier);
315 
316  ret = iso_image_import(o->image, ds, ropts, &features);
317  iso_tree_set_report_callback(o->image, NULL);
318  iso_read_opts_free(ropts);
319  ropts= NULL;
320 
321  if (ret < 0) {
322  isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0);
323  goto ex;
324  }
325  /* Important: do not return until free(features) */
326  if (image!=NULL) {
327  *image = o->image;
328  iso_image_ref(*image); /*protects object from premature free*/
329  }
330  read_opts->hasRR = iso_read_image_features_has_rockridge(features);
331  read_opts->hasJoliet = iso_read_image_features_has_joliet(features);
332  read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features);
333  read_opts->hasElTorito = iso_read_image_features_has_eltorito(features);
334  read_opts->size = iso_read_image_features_get_size(features);
335  read_opts->tree_loaded = iso_read_image_features_tree_loaded(features);
336  read_opts->rr_loaded = iso_read_image_features_rr_loaded(features);
337  ret= 1;
338 ex:;
339  if(msg != NULL)
340  free(msg);
341  if(ropts != NULL)
342  iso_read_opts_free(ropts);
343  if(features != NULL)
344  iso_read_image_features_destroy(features);
345  return(ret);
346 }
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
Obtain the start block number of the most recent session on the medium.
Definition: burn_wrap.c:799
IsoDataSource * isoburn_data_source_new(struct burn_drive *d, uint32_t displacement, int displacement_sign, int cache_tiles, int tile_blocks)
Get a data source suitable for read from a drive using burn_read_data() function.
Definition: data_source.c:325
int isoburn_root_defaults(IsoImage *image, int flag)
Initialize the root directory attributes of a freshly created image.
Definition: isofs_wrap.c:129
static void isoburn_idle_free_function(void *ignored)
Definition: isofs_wrap.c:123
int cache_tile_blocks
Definition: isoburn.h:320
unsigned int hasIso1999
It will be set to 1 if the image is an ISO 9660:1999, i.e.
Definition: isoburn.h:384
uid_t uid
Default uid when no RR.
Definition: isoburn.h:346
unsigned int hasRR
Definition: isoburn.h:375
mode_t dirmode
Default mode for directories when no RR (only permissions)
Definition: isoburn.h:349
unsigned int noaaip
Definition: isoburn.h:333
int truncate_mode
What to do in case of name longer than truncate_length: 0= throw FAILURE 1= truncate to truncate_leng...
Definition: isoburn.h:371
unsigned int hasJoliet
Definition: isoburn.h:377
uint32_t size
Will be filled with the size (in 2048 byte block) of the image, as reported in the PVM.
Definition: isoburn.h:389
mode_t mode
Default mode when no RR (only permissions)
Definition: isoburn.h:348
unsigned int noino
Definition: isoburn.h:338
unsigned int nojoliet
Definition: isoburn.h:323
unsigned int norock
Definition: isoburn.h:322
uint32_t displacement
Definition: isoburn.h:398
unsigned int do_ecma119_map
Definition: isoburn.h:326
unsigned int map_mode
Definition: isoburn.h:327
unsigned int nomd5
Definition: isoburn.h:341
char * input_charset
Input charset for RR file names.
Definition: isoburn.h:355
unsigned int noiso1999
Definition: isoburn.h:324
unsigned int preferjoliet
Definition: isoburn.h:343
int displacement_sign
Definition: isoburn.h:399
unsigned int hasElTorito
It will be set to 1 if El-Torito boot record is present, to 0 if not.
Definition: isoburn.h:387
unsigned int do_joliet_map
Definition: isoburn.h:329
int auto_input_charset
Enable or disable methods to automatically choose an input charset.
Definition: isoburn.h:364
unsigned int joliet_map_mode
Definition: isoburn.h:330
unsigned int pretend_blank
Definition: isoburn.h:396
gid_t gid
Default uid when no RR.
Definition: isoburn.h:347
void * read_pacifier_handle
Definition: isoburn.h:160
IsoDataSource * iso_data_source
Definition: isoburn.h:149
int(* read_pacifier)(IsoImage *, IsoFileSource *)
Definition: isoburn.h:157

References isoburn_read_opts::auto_input_charset, isoburn_read_opts::cache_tile_blocks, isoburn_read_opts::cache_tiles, isoburn_read_opts::dirmode, isoburn_read_opts::displacement, isoburn_read_opts::displacement_sign, isoburn_read_opts::do_ecma119_map, isoburn_read_opts::do_joliet_map, isoburn_read_opts::gid, isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, isoburn::image, isoburn::image_start_lba, isoburn_read_opts::input_charset, isoburn::iso_data_source, isoburn_data_source_new(), isoburn_disc_get_msc1(), isoburn_disc_get_status(), isoburn_find_emulator(), isoburn_idle_free_function(), isoburn_msgs_submit(), isoburn_read_iso_head(), isoburn_report_iso_error(), isoburn_root_defaults(), isoburn_read_opts::joliet_map_mode, isoburn_read_opts::map_mode, isoburn_read_opts::mode, isoburn_read_opts::noaaip, isoburn_read_opts::noino, isoburn_read_opts::noiso1999, isoburn_read_opts::nojoliet, isoburn_read_opts::nomd5, isoburn_read_opts::norock, isoburn_read_opts::preferjoliet, isoburn_read_opts::pretend_blank, isoburn::read_pacifier, isoburn::read_pacifier_handle, isoburn_read_opts::rr_loaded, isoburn_read_opts::size, isoburn_read_opts::tree_loaded, isoburn_read_opts::truncate_length, isoburn_read_opts::truncate_mode, and isoburn_read_opts::uid.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_read_iso_head()

int isoburn_read_iso_head ( struct burn_drive *  d,
int  lba,
int *  image_blocks,
char *  info,
int  flag 
)

Try whether the data at the given address look like a ISO 9660 image header and obtain its alleged size.

Depending on the info mode one other string of text information can be retrieved too.

Since
0.1.6
Parameters
dThe drive with the medium to inspect
lbaThe block number from where to read
image_blocksReturns the number of 2048 bytes blocks in the session
infoCaller provided memory, enough to take possible info reply
flagbit0-7: info return mode 0= do not return anything in info (do not even touch it) 1= copy volume id to info (info needs 33 bytes) 2=
Since
0.2.2 : copy 64 kB header to info (needs 65536 bytes) bit13=
0.2.2: Do not read head from medium but use first 64 kB from info. In this case it is permissible to submit d == NULL. bit14= check both half buffers (not only second) return 2 if found in first block bit15= return -1 on read error
Returns
>0 seems to be a valid ISO image, 0 format not recognized, <0 error

Definition at line 1301 of file burn_wrap.c.

1303 {
1304  unsigned char *buffer= NULL;
1305  int ret, info_mode, capacity, role;
1306  off_t data_count, to_read;
1307  struct isoburn *o;
1308 
1309  buffer= calloc(1, 64 * 1024);
1310  if(buffer == NULL)
1311  {ret= -1; goto ex;}
1312 
1313  info_mode= flag&255;
1314  *image_blocks= 0;
1315  if(flag&(1<<13)) {
1316  memcpy(buffer, info, 64*1024);
1317  } else {
1318  memset(buffer, 0, 64 * 1024);
1319  role = burn_drive_get_drive_role(d);
1320  if (role == 3 || role == 5)
1321 
1322  /* >>> ??? return always 0 ? */
1323  {ret= (-1*!!(flag&(1<<15))); goto ex;}
1324 
1325  ret = burn_get_read_capacity(d, &capacity, 0);
1326  if (ret <= 0 && (role == 2 || role == 4)) {
1327  /* Might be a block device on a system where libburn cannot determine its
1328  size. Try to read anyway. */
1329  capacity = 0x7ffffff0;
1330  ret = 1;
1331  }
1332  to_read= (off_t) capacity * ((off_t) 2048);
1333  if(ret > 0 && to_read >= (off_t) (36 * 1024)) {
1334  ret= isoburn_find_emulator(&o, d, 0);
1335  if(ret > 0)
1336  if(o->media_read_error)
1337  {ret= (-1 * !!(flag & (1 << 15))); goto ex;}
1338  if(to_read >= (off_t) (64 * 1024))
1339  to_read= 64 * 1024;
1340  ret = burn_read_data(d, ((off_t) lba) * (off_t) 2048, (char *) buffer,
1341  to_read, &data_count, 32); /* error messages as DEBUG */
1342  } else
1343  ret= 0;
1344  if(ret<=0)
1345  {ret= (-1*!!(flag&(1<<15))); goto ex;}
1346  if(info_mode==2)
1347  memcpy(info, buffer, 64*1024);
1348  }
1349 
1350  if(flag&(1<<14)) {
1351  ret= isoburn_read_iso_head_parse(buffer, image_blocks, info, info_mode);
1352  if(ret<0)
1353  goto ex;
1354  if(ret>0)
1355  {ret= 2; goto ex;}
1356  }
1357  ret= isoburn_read_iso_head_parse(buffer+32*1024, image_blocks, info,
1358  info_mode);
1359  if(ret<=0)
1360  goto ex;
1361  ret= 1;
1362 ex:;
1363  if(buffer != NULL)
1364  free(buffer);
1365  return(ret);
1366 }
int isoburn_read_iso_head_parse(unsigned char *data, int *image_blocks, char *info, int flag)
Definition: burn_wrap.c:1253
int media_read_error
Definition: isoburn.h:118

References isoburn_find_emulator(), isoburn_read_iso_head_parse(), and isoburn::media_read_error.

Referenced by isoburn_emulate_toc(), isoburn_get_mount_params(), isoburn_read_image(), isoburn_set_msc1(), Xorriso_adjust_relocated_sb(), Xorriso_assert_volid(), Xorriso_burn_track(), Xorriso_check_media(), Xorriso_set_system_area(), Xorriso_toc(), Xorriso_truncate_overwritable(), and Xorriso_update_iso_lba0().

◆ isoburn_ropt_destroy()

int isoburn_ropt_destroy ( struct isoburn_read_opts **  o,
int  flag 
)

Deletes an option set which was created by isoburn_ropt_new().

Since
0.1.0
Parameters
oThe option set to work on
flagBitfield for control purposes. Submit 0 for now.
Returns
1= **o destroyed , 0= *o was already NULL (harmless)

Definition at line 886 of file isoburn.c.

887 {
888  if(*o==NULL)
889  return(0);
890  free(*o);
891  *o= NULL;
892  return(1);
893 }

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_ropt_get_auto_incharset()

int isoburn_ropt_get_auto_incharset ( struct isoburn_read_opts o,
int *  mode 
)

Definition at line 1050 of file isoburn.c.

1051 {
1052  *mode= o->auto_input_charset;
1053  return(1);
1054 }

References isoburn_read_opts::auto_input_charset, and isoburn_read_opts::mode.

◆ isoburn_ropt_get_data_cache()

int isoburn_ropt_get_data_cache ( struct isoburn_read_opts o,
int *  cache_tiles,
int *  tile_blocks,
int *  set_flag,
int  flag 
)

Inquire the current settings of isoburn_set_data_cache().

Since
1.2.2
Parameters
oThe option set to work on. NULL has the same effect as flag bit0.
cache_tilesWill return the number of tiles in the cache.
tile_blocksWill return the number of blocks per tile.
set_flagWill return control bits. None are defined yet.
flagBitfield for control purposes bit0= return default values rather than current ones
Returns
<=0 error , >0 reply is valid

Definition at line 932 of file isoburn.c.

935 {
936  if((flag & 1) || o == NULL) {
937  *cache_tiles= Libisoburn_default_cache_tileS;
938  *tile_blocks= Libisoburn_default_tile_blockS;
939  *set_flag= 0;
940  return(1);
941  }
942  *cache_tiles= o->cache_tiles;
943  *tile_blocks= o->cache_tile_blocks;
944  *set_flag= 0;
945  return(1);
946 }
#define Libisoburn_default_tile_blockS
Definition: isoburn.h:279
#define Libisoburn_default_cache_tileS
Default settings for above cache_tiles, tile_blocks in newly created struct isoburn_read_opts.
Definition: isoburn.h:278

References isoburn_read_opts::cache_tile_blocks, isoburn_read_opts::cache_tiles, Libisoburn_default_cache_tileS, and Libisoburn_default_tile_blockS.

Referenced by Xorriso_set_data_cache().

◆ isoburn_ropt_get_default_dirperms()

int isoburn_ropt_get_default_dirperms ( struct isoburn_read_opts o,
mode_t *  mode 
)

Definition at line 1019 of file isoburn.c.

1021 {
1022  *mode= o->dirmode;
1023  return(1);
1024 }

References isoburn_read_opts::dirmode, and isoburn_read_opts::mode.

◆ isoburn_ropt_get_default_perms()

int isoburn_ropt_get_default_perms ( struct isoburn_read_opts o,
uid_t *  uid,
gid_t *  gid,
mode_t *  mode 
)

Definition at line 1001 of file isoburn.c.

1003 {
1004  *uid= o->uid;
1005  *gid= o->gid;
1006  *mode= o->mode;
1007  return(1);
1008 }

References isoburn_read_opts::gid, isoburn_read_opts::mode, and isoburn_read_opts::uid.

◆ isoburn_ropt_get_displacement()

int isoburn_ropt_get_displacement ( struct isoburn_read_opts o,
uint32_t *  displacement,
int *  displacement_sign 
)

Definition at line 1066 of file isoburn.c.

1068 {
1069  *displacement= o->displacement;
1070  *displacement_sign= o->displacement_sign;
1071  return(1);
1072 }

References isoburn_read_opts::displacement, and isoburn_read_opts::displacement_sign.

◆ isoburn_ropt_get_extensions()

int isoburn_ropt_get_extensions ( struct isoburn_read_opts o,
int *  ext 
)

Definition at line 969 of file isoburn.c.

970 {
971  *ext= (!!o->norock) | ((!!o->nojoliet)<<1) | ((!!o->noiso1999)<<2) |
972  ((!!o->preferjoliet)<<3) | ((!!o->pretend_blank)<<4) |
973  ((!!o->noaaip) << 5) | ((!!o->noacl) << 6) | ((!!o->noea) << 7) |
974  ((!!o->noino) << 8) | ((o->nomd5 & 3) << 9) |
975  ((!!o->do_ecma119_map) << 11) | ((o->map_mode & 3) << 12) |
976  ((!!o->do_joliet_map) << 14) | ((!!o->joliet_map_mode) << 15);
977  return(1);
978 }
unsigned int noacl
Definition: isoburn.h:334
unsigned int noea
Definition: isoburn.h:335

References isoburn_read_opts::do_ecma119_map, isoburn_read_opts::do_joliet_map, isoburn_read_opts::joliet_map_mode, isoburn_read_opts::map_mode, isoburn_read_opts::noaaip, isoburn_read_opts::noacl, isoburn_read_opts::noea, isoburn_read_opts::noino, isoburn_read_opts::noiso1999, isoburn_read_opts::nojoliet, isoburn_read_opts::nomd5, isoburn_read_opts::norock, isoburn_read_opts::preferjoliet, and isoburn_read_opts::pretend_blank.

◆ isoburn_ropt_get_input_charset()

int isoburn_ropt_get_input_charset ( struct isoburn_read_opts o,
char **  input_charset 
)

Definition at line 1035 of file isoburn.c.

1037 {
1038  *input_charset= o->input_charset;
1039  return(1);
1040 }

References isoburn_read_opts::input_charset.

◆ isoburn_ropt_get_size_what()

int isoburn_ropt_get_size_what ( struct isoburn_read_opts o,
uint32_t *  size,
int *  has_what 
)

Definition at line 1099 of file isoburn.c.

1101 {
1102  *size= o->size;
1103  *has_what= (!!o->hasRR) | ((!!o->hasJoliet)<<1) |
1104  ((!!o->hasIso1999)<<2) | ((!!o->hasElTorito)<<3);
1105  return(1);
1106 }

References isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, and isoburn_read_opts::size.

Referenced by Xorriso_aquire_drive().

◆ isoburn_ropt_get_tree_loaded()

int isoburn_ropt_get_tree_loaded ( struct isoburn_read_opts o,
int *  tree,
int *  rr 
)

After calling function isoburn_read_image() there are information available in the option set about which tree was used for image loading and whether Rock Ridge information was actually used.

Since
1.5.4
Parameters
oThe option set to work on
treeThe tree which was loaded: 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999
rr1= Rock Ridge information was used, 0 = No Rock Ridge was used
Returns
1 success, <=0 failure

Definition at line 1109 of file isoburn.c.

1111 {
1112  *tree= o->tree_loaded;
1113  *rr= o->rr_loaded;
1114  return(1);
1115 }

References isoburn_read_opts::rr_loaded, and isoburn_read_opts::tree_loaded.

Referenced by Xorriso_aquire_drive().

◆ isoburn_ropt_get_truncate_mode()

int isoburn_ropt_get_truncate_mode ( struct isoburn_read_opts o,
int *  mode,
int *  length 
)

Definition at line 1090 of file isoburn.c.

1092 {
1093  *mode= o->truncate_mode;
1094  *length= o->truncate_length;
1095  return(1);
1096 }

References isoburn_read_opts::mode, isoburn_read_opts::truncate_length, and isoburn_read_opts::truncate_mode.

◆ isoburn_ropt_new()

int isoburn_ropt_new ( struct isoburn_read_opts **  o,
int  flag 
)

Produces a set of image read options, initialized with default values.

Since
0.1.0
Parameters
othe newly created option set object
flagBitfield for control purposes. Submit 0 for now.
Returns
1=ok , <0 = failure

Definition at line 842 of file isoburn.c.

843 {
844  struct isoburn_read_opts *o;
845 
846  o= (*new_o)= calloc(1, sizeof(struct isoburn_read_opts));
847  if(o==NULL) {
848  isoburn_msgs_submit(NULL, 0x00060000,
849  "Cannot allocate memory for read options", 0, "FATAL", 0);
850  return(-1);
851  }
854  o->norock= 0;
855  o->nojoliet= 0;
856  o->noiso1999= 1;
857  o->do_ecma119_map= 0;
858  o->map_mode= 1;
859  o->do_joliet_map= 0;
860  o->joliet_map_mode= 1;
861  o->noaaip= 1;
862  o->noacl= 1;
863  o->noea= 1;
864  o->noino= 1;
865  o->nomd5= 1;
866  o->preferjoliet= 0;
867  o->uid= geteuid();
868  o->gid= getegid();
869  o->mode= 0444;
870  o->dirmode= 0555;
871  o->input_charset= NULL;
872  o->truncate_mode= 1;
873  o->truncate_length= 255;
874  o->hasRR= 0;
875  o->hasJoliet= 0;
876  o->hasIso1999= 0;
877  o->hasElTorito= 0;
878  o->size= 0;
879  o->pretend_blank= 1;
880  o->displacement= 0;
881  o->displacement_sign= 0;
882  return(1);
883 }
Options for image reading.
Definition: isoburn.h:318

References isoburn_read_opts::cache_tile_blocks, isoburn_read_opts::cache_tiles, isoburn_read_opts::dirmode, isoburn_read_opts::displacement, isoburn_read_opts::displacement_sign, isoburn_read_opts::do_ecma119_map, isoburn_read_opts::do_joliet_map, isoburn_read_opts::gid, isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, isoburn_read_opts::input_charset, isoburn_msgs_submit(), isoburn_read_opts::joliet_map_mode, Libisoburn_default_cache_tileS, Libisoburn_default_tile_blockS, isoburn_read_opts::map_mode, isoburn_read_opts::mode, isoburn_read_opts::noaaip, isoburn_read_opts::noacl, isoburn_read_opts::noea, isoburn_read_opts::noino, isoburn_read_opts::noiso1999, isoburn_read_opts::nojoliet, isoburn_read_opts::nomd5, isoburn_read_opts::norock, isoburn_read_opts::preferjoliet, isoburn_read_opts::pretend_blank, isoburn_read_opts::size, isoburn_read_opts::truncate_length, isoburn_read_opts::truncate_mode, and isoburn_read_opts::uid.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_ropt_set_auto_incharset()

int isoburn_ropt_set_auto_incharset ( struct isoburn_read_opts o,
int  mode 
)

Enable or disable methods to automatically choose an input charset.

This eventually overrides the name set via isoburn_ropt_set_input_charset()

Since
0.3.8
Parameters
oThe option set to work on
modeBitfield for control purposes: bit0= set the input character set automatically from attribute "isofs.cs" of root directory. Submit any other bits with value 0.
Returns
1 success, <=0 failure

Definition at line 1043 of file isoburn.c.

1044 {
1045  o->auto_input_charset= mode & 1;
1046  return(1);
1047 }

References isoburn_read_opts::auto_input_charset, and isoburn_read_opts::mode.

Referenced by Xorriso_aquire_drive().

◆ isoburn_ropt_set_data_cache()

int isoburn_ropt_set_data_cache ( struct isoburn_read_opts o,
int  cache_tiles,
int  tile_blocks,
int  flag 
)

Sets the size and granularity of the cache which libisoburn provides to libisofs for reading of ISO image data.

This cache consists of several tiles which are buffers of a given size. The ISO image is divided into virtual tiles of that size. A cache tile may hold an in-memory copy of such a virtual image tile. When libisofs requests to read a block, then first the cache is inquired whether it holds that block. If not, then the block is read via libburn together with its neighbors in their virtual image tile into a free cache tile. If no cache tile is free, then the one will be re-used which has the longest time of not being hit by a read attempt.

A larger cache might speed up image loading by reducing the number of libburn read calls on the directory tree. It might also help with reading the content of many small files, if for some reason it is not an option to sort access by LBA. Caching will not provide much benefit with libburn "stdio:" drives, because the operating system is supposed to provide the same speed-up in a more flexible way.

Since
1.2.2
Parameters
oThe option set to work on. It is permissible to submit NULL in order to just have the parameters tested.
cache_tilesNumber of tiles in the cache. Not less than 1. Default is 32.
tile_blocksNumber of blocks per tile. Must be a power of 2. Default is 32. cache_tiles * tile_blocks * 2048 must not exceed 1073741824 (= 1 GiB).
flagBitfield for control purposes. Unused yet. Submit 0.
Returns
<=0 error , >0 ok

Definition at line 896 of file isoburn.c.

898 {
899  int i;
900  char msg[80];
901 
902  if(cache_tiles < 1) {
903  isoburn_msgs_submit(NULL, 0x00060000,
904  "Requested number of data cache tiles is too small (< 1)",
905  0, "SORRY", 0);
906  return(0);
907  }
908  if(((double) cache_tiles) * ((double) tile_blocks)
909  > (double) Libisoburn_cache_max_sizE) {
910  sprintf(msg, "Requested size of data cache exceeds limit of %.f blocks",
911  (double) Libisoburn_cache_max_sizE);
912  isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "SORRY", 0);
913  return(0);
914  }
915  for(i = 1; i <= Libisoburn_cache_max_sizE; i = i << 1)
916  if(i == tile_blocks)
917  break;
918  if(i > Libisoburn_cache_max_sizE) {
919  isoburn_msgs_submit(NULL, 0x00060000,
920  "Requested number of blocks per data cache tiles is not a power of 2",
921  0, "SORRY", 0);
922  return(0);
923  }
924  if(o != NULL) {
925  o->cache_tiles= cache_tiles;
926  o->cache_tile_blocks= tile_blocks;
927  }
928  return(1);
929 }
#define Libisoburn_cache_max_sizE
Maximum size of the cache in 2 kB blocks (1 GB)
Definition: isoburn.h:283

References isoburn_read_opts::cache_tile_blocks, isoburn_read_opts::cache_tiles, isoburn_msgs_submit(), and Libisoburn_cache_max_sizE.

Referenced by Xorriso_create_empty_iso(), and Xorriso_set_data_cache().

◆ isoburn_ropt_set_default_dirperms()

int isoburn_ropt_set_default_dirperms ( struct isoburn_read_opts o,
mode_t  mode 
)

Default attributes to use on directories if no RockRidge extension gets loaded.

Above call isoburn_ropt_set_default_perms() automatically adds x-permissions to r-permissions for directories. This call here may be done afterwards to set independent permissions for directories, especially to override the automatically added x-permissions.

Since
0.1.0
Parameters
oThe option set to work on
modepermissions (not file type) as of man 2 stat.
Returns
1 success, <=0 failure

Definition at line 1011 of file isoburn.c.

1013 {
1014  o->dirmode= mode;
1015  return(1);
1016 }

References isoburn_read_opts::dirmode, and isoburn_read_opts::mode.

◆ isoburn_ropt_set_default_perms()

int isoburn_ropt_set_default_perms ( struct isoburn_read_opts o,
uid_t  uid,
gid_t  gid,
mode_t  mode 
)

Default attributes to use if no RockRidge extension gets loaded.

Since
0.1.0
Parameters
oThe option set to work on
uiduser id number (see /etc/passwd)
gidgroup id number (see /etc/group)
modepermissions (not file type) as of man 2 stat. With directories, r-permissions will automatically imply x-permissions. See isoburn_ropt_set_default_dirperms() below.
Returns
1 success, <=0 failure

Definition at line 981 of file isoburn.c.

983 {
984  mode_t dirmode;
985 
986  o->uid= uid;
987  o->gid= gid;
988  o->mode= mode;
989  dirmode= mode;
990  if(dirmode & S_IRUSR)
991  dirmode|= S_IXUSR;
992  if(dirmode & S_IRGRP)
993  dirmode|= S_IXGRP;
994  if(dirmode & S_IROTH)
995  dirmode|= S_IXOTH;
996  o->dirmode= dirmode;
997  return(1);
998 }

References isoburn_read_opts::dirmode, isoburn_read_opts::gid, isoburn_read_opts::mode, and isoburn_read_opts::uid.

Referenced by Xorriso_aquire_drive().

◆ isoburn_ropt_set_displacement()

int isoburn_ropt_set_displacement ( struct isoburn_read_opts o,
uint32_t  displacement,
int  displacement_sign 
)

Control an offset to be applied to all block address pointers in the ISO image in order to compensate for an eventual displacement of the image relative to the start block address for which it was produced.

E.g. if track number 2 from CD gets copied into a disk file and shall then be loaded as ISO filesystem, then the directory tree and all data file content of the track copy will become readable by setting the track start address as displacement and -1 as displacement_sign. Data file content outside the track will of course not be accessible and eventually produce read errors.

Since
0.6.6
Parameters
oThe option set to work on
displacement0 or a positive number
displacement_signDetermines whether to add or subtract displacement to block addresses before applying them to the storage object for reading: +1 = add , -1= subtract , else keep unaltered

Definition at line 1057 of file isoburn.c.

1059 {
1060  o->displacement= displacement;
1061  o->displacement_sign= displacement_sign;
1062  return(1);
1063 }

References isoburn_read_opts::displacement, and isoburn_read_opts::displacement_sign.

Referenced by Xorriso_aquire_drive().

◆ isoburn_ropt_set_extensions()

int isoburn_ropt_set_extensions ( struct isoburn_read_opts o,
int  ext 
)

Definition at line 949 of file isoburn.c.

950 {
951  o->norock= !!(ext&1);
952  o->nojoliet= !!(ext&2);
953  o->noiso1999= !!(ext&4);
954  o->preferjoliet= !!(ext&8);
955  o->pretend_blank= !!(ext&16);
956  o->noaaip= !!(ext & 32);
957  o->noacl= !!(ext & 64);
958  o->noea= !!(ext & 128);
959  o->noino= !!(ext & 256);
960  o->nomd5= (ext >> 9) & 3;
961  o->do_ecma119_map= !!(ext & 2048);
962  o->map_mode= (ext >> 12) & 3;
963  o->do_joliet_map= !!(ext & 16384);
964  o->joliet_map_mode= !!(ext & 32768);
965  return(1);
966 }

References isoburn_read_opts::do_ecma119_map, isoburn_read_opts::do_joliet_map, isoburn_read_opts::joliet_map_mode, isoburn_read_opts::map_mode, isoburn_read_opts::noaaip, isoburn_read_opts::noacl, isoburn_read_opts::noea, isoburn_read_opts::noino, isoburn_read_opts::noiso1999, isoburn_read_opts::nojoliet, isoburn_read_opts::nomd5, isoburn_read_opts::norock, isoburn_read_opts::preferjoliet, and isoburn_read_opts::pretend_blank.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_ropt_set_input_charset()

int isoburn_ropt_set_input_charset ( struct isoburn_read_opts o,
char *  input_charset 
)

Set the character set for reading RR file names from ISO images.

Since
0.1.0
Parameters
oThe option set to work on
input_charsetSet this to NULL to use the default locale charset For selecting a particular character set, submit its name, e.g. as listed by program iconv -l. Example: "UTF-8".
Returns
1 success, <=0 failure

Definition at line 1027 of file isoburn.c.

1029 {
1030  o->input_charset= input_charset;
1031  return(1);
1032 }

References isoburn_read_opts::input_charset.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_ropt_set_truncate_mode()

int isoburn_ropt_set_truncate_mode ( struct isoburn_read_opts o,
int  mode,
int  length 
)

Set the name truncation mode and the maximum name length for imported file objects.

Since
1.4.2
Parameters
oThe option set to work on
mode0= Do not truncate but throw error ISO_RR_NAME_TOO_LONG if a file name is longer than parameter length. 1= Truncate to length and overwrite the last 32 bytes of that length by the hex representation of the MD5 of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. This is the default.
lengthMaximum byte count of a file name. Permissible values are 64 to 255. Default is 255.

Definition at line 1075 of file isoburn.c.

1077 {
1078  if(mode < 0 || mode > 1)
1079  mode= 1;
1080  if(length < 64)
1081  length= 64;
1082  if(length > 255)
1083  length= 255;
1084  o->truncate_mode= mode;
1085  o->truncate_length= length;
1086  return(1);
1087 }

References isoburn_read_opts::mode, isoburn_read_opts::truncate_length, and isoburn_read_opts::truncate_mode.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_set_msc1()

int isoburn_set_msc1 ( struct burn_drive *  d,
int  adr_mode,
char *  adr_value,
int  flag 
)

Set up isoburn_disc_get_msc1() to return a fabricated value.

This makes only sense between acquiring the drive and reading the image. After isoburn_read_image() it will confuse the coordination of libisoburn and libisofs. Note: Sessions and tracks are counted beginning with 1, not with 0.

Since
0.1.6
Parameters
dThe drive where msc1 is to be set
adr_modeDetermines how to interpret adr_value and to set msc1. If adr_value shall represent a number then decimal ASCII digits are expected. 0= start lba of last session in TOC, ignore adr_value 1= start lba of session number given by adr_value 2= start lba of track number given by adr_value 3= adr_value itself is the lba to be used 4= start lba of last session with volume id given by adr_value
adr_valueA string describing the value to be eventually used.
flagBitfield for control purposes. bit0=
Since
0.2.2 with adr_mode 3: adr_value might be 16 blocks too high (e.g. -C stemming from growisofs). Probe for ISO head at adr_value-16 and eventually adjust setting. bit1= insist in seeing a disc object with at least one session bit2= with adr_mode 4: use adr_value as regular expression

Definition at line 1938 of file burn_wrap.c.

1940 {
1941  int ret, num_sessions= 0, num_tracks, adr_num, i, j, total_tracks;
1942  int lba, best_lba, size, re_valid= 0, track_count= 0;
1943  time_t start_time= 0, last_pacifier= 0, now;
1944  char volid[33], *msg= NULL;
1945  struct isoburn *o;
1946  struct isoburn_toc_disc *disc= NULL;
1947  struct isoburn_toc_session **sessions= NULL;
1948  struct isoburn_toc_track **tracks= NULL;
1949  static char mode_names[][20]= {"auto", "session", "track", "lba", "volid"};
1950  static int max_mode_names= 4;
1951  regex_t re;
1952  regmatch_t match[1];
1953  enum burn_disc_status s;
1954 
1955  ret= isoburn_find_emulator(&o, d, 0);
1956  if(ret<0)
1957  return(-1);
1958  if(o==NULL)
1959  return(-1);
1960 
1961  msg= calloc(1, 160);
1962  if(msg == NULL)
1963  {ret= -1; goto ex;}
1964 
1965  start_time= last_pacifier= time(NULL);
1966  adr_num= atoi(adr_value);
1967  if(adr_mode!=3 || (flag & 2)) {
1968  disc= isoburn_toc_drive_get_disc(d);
1969  if(disc==NULL) {
1970 not_found:;
1971  if(adr_mode<0 || adr_mode>max_mode_names)
1972  goto unknown_mode;
1973  sprintf(msg, "Failed to find %s %s", mode_names[adr_mode],
1974  strlen(adr_value)<=80 ? adr_value : "-oversized-string-");
1975  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
1976  ret= 0; goto ex;
1977  }
1978  sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions);
1979  if(sessions==NULL || num_sessions<=0)
1980  goto not_found;
1981  }
1982  if(adr_mode==0) {
1983  /* Set fabricated_msc1 to last session in TOC */
1984  tracks= isoburn_toc_session_get_tracks(sessions[num_sessions-1],
1985  &num_tracks);
1986  if(tracks==NULL || num_tracks<=0)
1987  goto not_found;
1988  isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0);
1989 
1990  } else if(adr_mode==1) {
1991  /* Use adr_num as session index (first session is 1, not 0) */
1992  if(adr_num<1 || adr_num>num_sessions)
1993  goto not_found;
1994  tracks= isoburn_toc_session_get_tracks(sessions[adr_num-1], &num_tracks);
1995  if(tracks==NULL || num_tracks<=0)
1996  goto not_found;
1997  isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0);
1998 
1999  } else if(adr_mode==2) {
2000  /* use adr_num as track index */
2001  total_tracks= 0;
2002  for(i=0; i<num_sessions; i++) {
2003  tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks);
2004  if(tracks==NULL)
2005  continue;
2006  for(j= 0; j<num_tracks; j++) {
2007  total_tracks++;
2008  if(total_tracks==adr_num) {
2009  isoburn_get_track_lba(tracks[j], &(o->fabricated_msc1), 0);
2010  ret= 1; goto ex;
2011  }
2012  }
2013  }
2014  goto not_found;
2015 
2016  } else if(adr_mode==3) {
2017  o->fabricated_msc1= adr_num;
2019  if(o->fabricated_msc1 > 0 && s != BURN_DISC_FULL
2020  && s != BURN_DISC_APPENDABLE) {
2021  isoburn_msgs_submit(o, 0x00060000,
2022  "Non-zero load offset given with blank input media",
2023  0, "FAILURE", 0);
2024  ret= 0; goto ex;
2025  }
2026  if((flag & 1) && o->fabricated_msc1 >= 16) {
2027  /* adr_num is possibly 16 blocks too high */
2028  ret= isoburn_read_iso_head(d, o->fabricated_msc1, &size,volid, 1|(1<<14));
2029  if(ret==2)
2030  o->fabricated_msc1-= 16;
2031  }
2032  } else if(adr_mode==4) {
2033  /* search for volume id that is equal to adr_value */
2034  if(flag & 4) {
2035  ret= regcomp(&re, adr_value, 0);
2036  if(ret != 0)
2037  flag&= ~4;
2038  else
2039  re_valid= 1;
2040  }
2041  best_lba= -1;
2042  for(i=0; i<num_sessions; i++) {
2043  tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks);
2044  if(tracks==NULL)
2045  continue;
2046  for(j= 0; j<num_tracks; j++) {
2047  now= time(NULL);
2048  if(now - last_pacifier >= 5 && track_count > 0) {
2049  last_pacifier= now;
2050  sprintf(msg,
2051  "Scanned %d tracks for matching volid in %.f seconds",
2052  track_count, (double) (now - start_time));
2053  isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
2054  }
2055  track_count++;
2056  ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0);
2057  if(ret < 0)
2058  continue;
2059  if(ret == 0) {
2060  isoburn_get_track_lba(tracks[0], &lba, 0);
2061  ret= isoburn_read_iso_head(d, lba, &size, volid, 1);
2062  if(ret<=0)
2063  continue;
2064  }
2065  if(flag & 4) {
2066  ret= regexec(&re, volid, 1, match, 0);
2067  if(ret != 0)
2068  continue;
2069  } else {
2070  if(strcmp(volid, adr_value)!=0)
2071  continue;
2072  }
2073  best_lba= lba;
2074  }
2075  }
2076  if(best_lba<0)
2077  goto not_found;
2078  o->fabricated_msc1= best_lba;
2079 
2080  } else {
2081 unknown_mode:;
2082  sprintf(msg, "Program error: Unknown msc1 address mode %d", adr_mode);
2083  isoburn_msgs_submit(o, 0x00060000, msg, 0, "FATAL", 0);
2084  ret= 0; goto ex;
2085  }
2086  ret= 1;
2087 ex:;
2088  if(start_time != last_pacifier && track_count > 0) {
2089  now= time(NULL);
2090  sprintf(msg,
2091  "Scanned %d tracks for matching volid in %.f seconds",
2092  track_count, (double) (now - start_time));
2093  isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
2094  }
2095  if(disc!=NULL)
2096  isoburn_toc_disc_free(disc);
2097  if((flag & 4) && re_valid)
2098  regfree(&re);
2099  if(msg != NULL)
2100  free(msg);
2101  return(ret);
2102 }
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, int *image_blocks, char volid[33], int flag)
Obtain eventual ISO image parameters of an emulated track.
Definition: burn_wrap.c:1878

References isoburn_toc_disc::disc, isoburn::fabricated_msc1, isoburn_disc_get_status(), isoburn_find_emulator(), isoburn_get_track_lba(), isoburn_msgs_submit(), isoburn_read_iso_head(), isoburn_toc_disc_free(), isoburn_toc_disc_get_sessions(), isoburn_toc_drive_get_disc(), isoburn_toc_session_get_tracks(), and isoburn_toc_track_get_emul().

Referenced by isoburn_get_mount_params(), and Xorriso_aquire_drive().

◆ isoburn_set_msgs_submit()

int isoburn_set_msgs_submit ( int(*)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)  msgs_submit,
void *  submit_handle,
int  submit_flag,
int  flag 
)

Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time.

For the library compatibility check, ISOBURN_*_VERSION in configure.ac are not decisive. Only the three numbers here do matter. Usage discussion:

Some developers of the libburnia project have differing opinions how to ensure the compatibility of libraries and applications.

It is about whether to use at compile time and at runtime the version numbers isoburn_header_version_* provided here. Thomas Schmitt advises to use them. Vreixo Formoso advises to use other means.

At compile time:

Vreixo Formoso advises to leave proper version matching to properly programmed checks in the the application's build system, which will eventually refuse compilation.

Thomas Schmitt advises to use the macros defined here for comparison with the application's requirements of library revisions and to eventually break compilation.

Both advises are combinable. I.e. be master of your build system and have #if checks in the source code of your application, nevertheless.

At runtime (via *_is_compatible()):

Vreixo Formoso advises to compare the application's requirements of library revisions with the runtime library. This is to allow runtime libraries which are young enough for the application but too old for the lib*.h files seen at compile time.

Thomas Schmitt advises to compare the header revisions defined here with the runtime library. This is to enforce a strictly monotonous chain of revisions from app to header to library, at the cost of excluding some older libraries.

These two advises are mutually exclusive.


For an implementation of the Thomas Schmitt approach, see libisoburn/burn_wrap.c : isoburn_initialize() This connects libisoburn as "application" with libisofs as "library".

The compatible part of Vreixo Formoso's approach is implemented in configure.ac LIBBURN_REQUIRED, LIBISOFS_REQUIRED. In isoburn_initialize() it would rather test by iso_lib_is_compatible(isoburn_libisofs_req_major,... than by iso_lib_is_compatible(iso_lib_header_version_major,... and would leave out the ugly compile time traps. Announce to the library an application provided method for immediate delivery of messages. It is used when no drive is affected directly or if the drive has no own msgs_submit() method attached by isoburn_drive_set_msgs_submit. If no method is preset or if the method is set to NULL then libisoburn delivers its messages through the message queue of libburn.

Parameters
msgs_submitThe function call which implements the method
submit_handleHandle to be used as first argument of msgs_submit
submit_flagFlag to be used as last argument of msgs_submit
flagUnused yet, submit 0
Since
0.2.0

Definition at line 303 of file burn_wrap.c.

307 {
308  libisoburn_default_msgs_submit= msgs_submit;
311  return(1);
312 }
int(* libisoburn_default_msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)
Definition: isoburn.c:51
int libisoburn_default_msgs_submit_flag
Definition: isoburn.c:54
void * libisoburn_default_msgs_submit_handle
Definition: isoburn.c:53

References libisoburn_default_msgs_submit, libisoburn_default_msgs_submit_flag, libisoburn_default_msgs_submit_handle, and isoburn::msgs_submit.

Referenced by Xorriso_startup_libraries().

◆ isoburn_set_read_pacifier()

int isoburn_set_read_pacifier ( struct burn_drive *  drive,
int(*)(IsoImage *, IsoFileSource *)  read_pacifier,
void *  app_handle 
)

Set a callback function for producing pacifier messages during the lengthy process of image reading.

The callback function and the application handle are stored until they are needed for the underlying call to libisofs. Other than with libisofs the handle is managed entirely by the application. An idle .free() function is exposed to libisofs. The handle has to stay valid until isoburn_read_image() is done. It has to be detached by isoburn_set_read_pacifier(drive, NULL, NULL); before it may be removed from memory.

Since
0.1.0
Parameters
driveThe drive which will be used with isoburn_read_image() It has to be acquired by an isoburn_* wrapper call.
read_pacifierThe callback function
app_handleThe app handle which the callback function can obtain via iso_image_get_attached_data() from its IsoImage*
Returns
1 success, <=0 failure

Definition at line 706 of file isofs_wrap.c.

709 {
710  int ret;
711  struct isoburn *o;
712 
713  ret = isoburn_find_emulator(&o, drive, 0);
714  if(ret < 0 || o == NULL)
715  return -1;
716  o->read_pacifier_handle= read_handle;
718  return(1);
719 }

References isoburn::drive, isoburn_find_emulator(), isoburn::read_pacifier, and isoburn::read_pacifier_handle.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_set_truncate()

int isoburn_set_truncate ( struct burn_drive *  drive,
int  flag 
)

Override the truncation setting that was made with flag bit2 during the call of isoburn_drive_aquire.

This applies only to stdio pseudo drives.

Since
0.1.6
Parameters
driveThe drive which was acquired and shall be used for writing.
flagBitfield controlling the setting: bit0= truncate (else do not truncate) bit1= do not warn if call is inappropriate to drive bit2= only set if truncation is currently enabled do not warn if call is inappropriate to drive
Returns
1 success, 0 inappropriate drive, <0 severe error

Definition at line 885 of file burn_wrap.c.

886 {
887  int ret;
888  struct isoburn *o;
889 
890  ret= isoburn_find_emulator(&o, drive, 0);
891  if(ret < 0)
892  return ret;
893  if(o == NULL) {
894  if(!(flag & (2 | 4)))
895  isoburn_msgs_submit(o, 0x00060000,
896  "Drive type or role is inappropriate for truncation", 0, "WARNING", 0);
897  return(0);
898  }
899  if(o->truncate || !(flag & 4))
900  o->truncate= flag & 1;
901  return(1);
902 }

References isoburn::drive, isoburn_find_emulator(), isoburn_msgs_submit(), and isoburn::truncate.

Referenced by Xorriso_write_session().

◆ isoburn_sync_after_write()

int isoburn_sync_after_write ( struct burn_drive *  input_drive,
struct burn_drive *  output_drive,
int  flag 
)

Wait after normal end of operations until libisofs ended all write threads and freed resource reservations.

This call is not mandatory. But without it, messages from the ending threads might appear after the application ended its write procedure.

Since
0.1.0
Parameters
input_driveThe drive or in_drive which was used with the preparation call.
output_driveThe out_drive used with isoburn_prepare_new_image(), NULL if none.
flagBitfield, submit 0 for now.
Returns
<=0 error , 1 = success

Definition at line 801 of file isoburn.c.

803 {
804  return isoburn_cancel_prepared_write(d, output_drive, 1);
805 }
int isoburn_cancel_prepared_write(struct burn_drive *d, struct burn_drive *output_drive, int flag)
Revoke isoburn_prepare_*() instead of running isoburn_disc_write().
Definition: isoburn.c:767

References isoburn_cancel_prepared_write().

Referenced by Xorriso_write_session().

◆ isoburn_toc_disc_free()

void isoburn_toc_disc_free ( struct isoburn_toc_disc disc)

Release the memory associated with a master handle of a medium.

The handle is invalid afterwards and may not be used any more. Wrapper for: burn_disc_free()

Since
0.1.6
Parameters
discThe master handle of the medium

Definition at line 1893 of file burn_wrap.c.

1894 {
1895  if(d->disc!=NULL)
1896  burn_disc_free(d->disc);
1898  free((char *) d);
1899 }
int isoburn_toc_destroy_arrays(struct isoburn_toc_disc *o, int flag)
Definition: burn_wrap.c:1613

References isoburn_toc_disc::disc, and isoburn_toc_destroy_arrays().

Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), isoburn_welcome_media(), Xorriso_check_media(), and Xorriso_toc().

◆ isoburn_toc_disc_get_incmpl_sess()

int isoburn_toc_disc_get_incmpl_sess ( struct isoburn_toc_disc disc)

Obtain the number of incomplete sessions which are recorded in the result array of isoburn_toc_disc_get_sessions() after the complete sessions.

See above.

Since
1.2.8
Parameters
discThe master handle of the medium
Returns
the number of incomplete sessions

Definition at line 1782 of file burn_wrap.c.

1783 {
1784  return(disc->incomplete_session_count);
1785 }
int incomplete_session_count
Definition: isoburn.h:839

References isoburn_toc_disc::incomplete_session_count.

Referenced by Xorriso_toc().

◆ isoburn_toc_disc_get_sectors()

int isoburn_toc_disc_get_sectors ( struct isoburn_toc_disc disc)

Tell the number of 2048 byte blocks covered by the table of content.

This number includes the eventual gaps between sessions and tracks. So this call is not really a wrapper for burn_disc_get_sectors().

Since
0.1.6
Parameters
discThe master handle of the medium
Returns
Number of blocks, <=0 indicates unknown or unreadable state

Definition at line 1728 of file burn_wrap.c.

1729 {
1730  struct isoburn_toc_entry *t;
1731  int ret= 0, num_sessions, num_tracks, open_sessions= 0, session_idx= -1;
1732  struct burn_session **sessions;
1733  struct burn_track **tracks;
1734  struct burn_toc_entry entry;
1735 
1736  if(disc==NULL)
1737  return(0);
1738  if(disc->toc!=NULL) {
1739  for(t= disc->toc; t!=NULL; t= t->next)
1740  ret= t->start_lba + t->track_blocks;
1741  } else if(disc->disc!=NULL) {
1742  sessions= burn_disc_get_sessions(disc->disc, &num_sessions);
1743  open_sessions= burn_disc_get_incomplete_sessions(disc->disc);
1744  if(num_sessions + open_sessions > 0) {
1745  session_idx= num_sessions + open_sessions - 1;
1746  tracks = burn_session_get_tracks(sessions[session_idx], &num_tracks);
1747  if(open_sessions > 0) {
1748  /* Do not count the invisible track of the last incomplete session */
1749  num_tracks--;
1750  }
1751  if(num_tracks <= 0)
1752  session_idx--;
1753  }
1754  if(session_idx >= 0) {
1755  tracks = burn_session_get_tracks(sessions[session_idx], &num_tracks);
1756  if(session_idx == num_sessions + open_sessions - 1 && open_sessions > 0) {
1757  /* Do not count the invisible track of the last incomplete session */
1758  num_tracks--;
1759  }
1760  if(num_tracks > 0) {
1761  burn_track_get_entry(tracks[num_tracks - 1], &entry);
1762  if(entry.extensions_valid & 1)
1763  ret= entry.start_lba + entry.track_blocks;
1764  }
1765  }
1766 /*
1767  ret= burn_disc_get_sectors(disc->disc);
1768 */
1769  }
1770  return(ret);
1771 }
struct isoburn_toc_entry * toc
Definition: isoburn.h:841
Definition: isoburn.h:27
int start_lba
Definition: isoburn.h:30
struct isoburn_toc_entry * next
Definition: isoburn.h:34
int track_blocks
Definition: isoburn.h:31

References isoburn_toc_disc::disc, isoburn_toc_entry::next, isoburn_toc_entry::start_lba, isoburn_toc_disc::toc, and isoburn_toc_entry::track_blocks.

Referenced by Xorriso_check_media().

◆ isoburn_toc_disc_get_sessions()

struct isoburn_toc_session** isoburn_toc_disc_get_sessions ( struct isoburn_toc_disc disc,
int *  num 
)

Get the array of session handles and the number of complete sessions from the table of content.

The result array contains *num + isoburn_toc_disc_get_incmpl_sess() elements. All above *num are incomplete sessions. Typically there is at most one incomplete session with no track. Wrapper for: burn_disc_get_sessions()

Since
0.1.6
Parameters
discThe master handle of the medium
numreturns the number of sessions in the array
Returns
the address of the array of session handles

Definition at line 1774 of file burn_wrap.c.

1776 {
1777  *num= disc->session_count;
1778  return(disc->session_pointers);
1779 }
struct isoburn_toc_session ** session_pointers
Definition: isoburn.h:835

References isoburn_toc_disc::session_count, and isoburn_toc_disc::session_pointers.

Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), isoburn_welcome_media(), Xorriso_check_media(), and Xorriso_toc().

◆ isoburn_toc_drive_get_disc()

struct isoburn_toc_disc* isoburn_toc_drive_get_disc ( struct burn_drive *  d)

Obtain a master handle for the table of content.

This handle governs allocated resources which have to be released by isoburn_toc_disc_free() when no longer needed. Wrapper for: burn_drive_get_disc()

Since
0.1.6
Parameters
dThe drive with the medium to inspect
Returns
NULL in case there is no content info, else it is a valid handle

Definition at line 1631 of file burn_wrap.c.

1632 {
1633  int ret, session_count= 0, track_count= 0, num_tracks= 0, i, j;
1634  int open_sessions= 0;
1635  struct isoburn *o;
1636  struct isoburn_toc_entry *t;
1637  struct isoburn_toc_disc *toc_disc= NULL;
1638  struct burn_session **s;
1639  struct burn_track **tracks;
1640 
1641  toc_disc= calloc(1, sizeof(struct isoburn_toc_disc));
1642  if(toc_disc==NULL)
1643  return(NULL);
1644  toc_disc->disc= NULL;
1645  toc_disc->sessions= NULL;
1646  toc_disc->session_pointers= NULL;
1647  toc_disc->tracks= NULL;
1648  toc_disc->track_pointers= NULL;
1649  toc_disc->session_count= 0;
1650  toc_disc->incomplete_session_count= 0;
1651  toc_disc->track_count= 0;
1652  toc_disc->toc= NULL;
1653 
1654  /* is the medium emulated multi-session ? */
1655  ret= isoburn_find_emulator(&o, d, 0);
1656  if(ret<0)
1657  goto libburn;
1658  if(o->toc==NULL)
1659  goto libburn;
1660 
1661  /* This is an emulated TOC */
1662  toc_disc->toc= o->toc;
1663  for(t= toc_disc->toc; t!=NULL; t= t->next)
1664  session_count++;
1665  ret= isoburn_toc_new_arrays(toc_disc, session_count, session_count, 0);
1666  if(ret<=0)
1667  goto failure;
1668  t= toc_disc->toc;
1669  for(i= 0; i<session_count; i++) {
1670  toc_disc->sessions[i].track_pointers= toc_disc->track_pointers+i;
1671  toc_disc->sessions[i].track_count= 1;
1672  toc_disc->sessions[i].toc_entry= t;
1673  toc_disc->session_pointers[i]= toc_disc->sessions+i;
1674  toc_disc->tracks[i].toc_entry= t;
1675  toc_disc->track_pointers[i]= toc_disc->tracks+i;
1676  t= t->next;
1677  }
1678  toc_disc->session_count= session_count;
1679  toc_disc->track_count= session_count;
1680  return(toc_disc);
1681 
1682 libburn:;
1683  /* This is a libburn provided TOC */
1684  toc_disc->disc= burn_drive_get_disc(d);
1685  if(toc_disc->disc == NULL) {
1686 failure:;
1687  free((char *) toc_disc);
1688  return(NULL);
1689  }
1690  s= burn_disc_get_sessions(toc_disc->disc, &session_count);
1691  open_sessions= burn_disc_get_incomplete_sessions(toc_disc->disc);
1692  for(i= 0; i < session_count + open_sessions; i++) {
1693  tracks = burn_session_get_tracks(s[i], &num_tracks);
1694  if(i == session_count + open_sessions - 1 && open_sessions > 0) {
1695  /* Do not count the invisible track of the last incomplete session */
1696  num_tracks--;
1697  }
1698  track_count+= num_tracks;
1699  }
1700  if(session_count + open_sessions <= 0 || track_count <= 0)
1701  goto failure;
1702  ret= isoburn_toc_new_arrays(toc_disc, session_count + open_sessions,
1703  track_count, 0);
1704  if(ret<=0)
1705  goto failure;
1706  track_count= 0;
1707  for(i= 0; i < session_count + open_sessions; i++) {
1708  tracks = burn_session_get_tracks(s[i], &num_tracks);
1709  if(i == session_count + open_sessions - 1 && open_sessions > 0)
1710  num_tracks--;
1711  toc_disc->sessions[i].session= s[i];
1712  toc_disc->sessions[i].track_pointers= toc_disc->track_pointers+track_count;
1713  toc_disc->sessions[i].track_count= num_tracks;
1714  toc_disc->session_pointers[i]= toc_disc->sessions+i;
1715  for(j= 0; j<num_tracks; j++) {
1716  toc_disc->tracks[track_count+j].track= tracks[j];
1717  toc_disc->track_pointers[track_count+j]= toc_disc->tracks+(track_count+j);
1718  }
1719  track_count+= num_tracks;
1720  }
1721  toc_disc->session_count= session_count;
1722  toc_disc->incomplete_session_count= open_sessions;
1723  toc_disc->track_count= track_count;
1724  return(toc_disc);
1725 }
int isoburn_toc_new_arrays(struct isoburn_toc_disc *o, int session_count, int track_count, int flag)
Definition: burn_wrap.c:1580
struct isoburn_toc_track ** track_pointers
Definition: isoburn.h:837
struct isoburn_toc_session * sessions
Definition: isoburn.h:834
struct isoburn_toc_track * tracks
Definition: isoburn.h:836
struct isoburn_toc_entry * toc_entry
Definition: isoburn.h:828
struct burn_session * session
Definition: isoburn.h:825
struct isoburn_toc_track ** track_pointers
Definition: isoburn.h:826
struct isoburn_toc_entry * toc_entry
Definition: isoburn.h:820
struct isoburn_toc_entry * toc
Definition: isoburn.h:123

References isoburn_toc_disc::disc, isoburn_toc_disc::incomplete_session_count, isoburn_find_emulator(), isoburn_toc_new_arrays(), isoburn_toc_entry::next, isoburn_toc_session::session, isoburn_toc_disc::session_count, isoburn_toc_disc::session_pointers, isoburn_toc_disc::sessions, isoburn::toc, isoburn_toc_disc::toc, isoburn_toc_track::toc_entry, isoburn_toc_session::toc_entry, isoburn_toc_track::track, isoburn_toc_session::track_count, isoburn_toc_disc::track_count, isoburn_toc_session::track_pointers, isoburn_toc_disc::track_pointers, and isoburn_toc_disc::tracks.

Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), isoburn_welcome_media(), Xorriso_check_media(), and Xorriso_toc().

◆ isoburn_toc_session_get_leadout_entry()

void isoburn_toc_session_get_leadout_entry ( struct isoburn_toc_session s,
struct burn_toc_entry *  entry 
)

Obtain a copy of the entry which describes the end of a particular session.

Wrapper for: burn_session_get_leadout_entry()

Since
0.1.6
Parameters
sThe session handle
entryA pointer to memory provided by the caller. It will be filled with info according to struct burn_toc_entry as defined in libburn.h

Definition at line 1831 of file burn_wrap.c.

1833 {
1834  struct isoburn_toc_track *t;
1835 
1836  if(s==NULL)
1837  return;
1838  if(s->session!=NULL && s->toc_entry==NULL) {
1839  burn_session_get_leadout_entry(s->session, entry);
1840  return;
1841  }
1842  if(s->track_count<=0 || s->track_pointers==NULL || s->toc_entry==NULL)
1843  return;
1844  t= s->track_pointers[s->track_count-1];
1845  entry->start_lba= t->toc_entry->start_lba + t->toc_entry->track_blocks;
1846  entry->track_blocks= 0;
1848  0);
1849 }
int isoburn_toc_entry_finish(struct burn_toc_entry *entry, int session_no, int track_no, int flag)
Definition: burn_wrap.c:1807
int session
Definition: isoburn.h:28
int track_no
Definition: isoburn.h:29

References isoburn_toc_entry_finish(), isoburn_toc_entry::session, isoburn_toc_session::session, isoburn_toc_entry::start_lba, isoburn_toc_track::toc_entry, isoburn_toc_session::toc_entry, isoburn_toc_entry::track_blocks, isoburn_toc_session::track_count, isoburn_toc_entry::track_no, and isoburn_toc_session::track_pointers.

Referenced by Xorriso_toc().

◆ isoburn_toc_session_get_sectors()

int isoburn_toc_session_get_sectors ( struct isoburn_toc_session s)

Tell the number of 2048 byte blocks covered by a particular session.

Wrapper for: burn_session_get_sectors()

Since
0.1.6
Parameters
sThe session handle
Returns
number of blocks, <=0 indicates unknown or unreadable state

Definition at line 1788 of file burn_wrap.c.

1789 {
1790  struct isoburn_toc_entry *t;
1791  int count= 0, i;
1792 
1793  if(s==NULL)
1794  return(0);
1795  if(s->toc_entry!=NULL) {
1796  t= s->toc_entry;
1797  for(i= 0; i<s->track_count; i++) {
1798  count+= t->track_blocks;
1799  t= t->next;
1800  }
1801  } else if(s->session!=NULL)
1802  count= burn_session_get_sectors(s->session);
1803  return(count);
1804 }

References isoburn_toc_entry::next, isoburn_toc_session::session, isoburn_toc_session::toc_entry, isoburn_toc_entry::track_blocks, and isoburn_toc_session::track_count.

◆ isoburn_toc_session_get_tracks()

struct isoburn_toc_track** isoburn_toc_session_get_tracks ( struct isoburn_toc_session s,
int *  num 
)

Get the array of track handles from a particular session.

Wrapper for: burn_session_get_tracks()

Since
0.1.6
Parameters
sThe session handle
numreturns the number of tracks in the array
Returns
the address of the array of track handles, NULL if no tracks are registered with session s

Definition at line 1852 of file burn_wrap.c.

1854 {
1855  *num= s->track_count;
1856  return(s->track_pointers);
1857 }

References isoburn_toc_session::track_count, and isoburn_toc_session::track_pointers.

Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), isoburn_welcome_media(), Xorriso_check_media(), and Xorriso_toc().

◆ isoburn_toc_track_get_emul()

int isoburn_toc_track_get_emul ( struct isoburn_toc_track t,
int *  start_lba,
int *  image_blocks,
char  volid[33],
int  flag 
)

Obtain eventual ISO image parameters of an emulated track.

This info was gained with much effort and thus gets cached in the track object. If this call returns 1 then one can save a call of isoburn_read_iso_head() with return mode 1 which could cause an expensive read operation.

Since
0.4.0
Parameters
tThe track handle
start_lbaReturns the start address of the ISO session
image_blocksReturns the number of 2048 bytes blocks
volidCaller provided memory for the volume id
flagunused yet, submit 0
Returns
0= not an emulated ISO session , 1= reply is valid

Definition at line 1878 of file burn_wrap.c.

1880 {
1881  if(t->toc_entry == NULL)
1882  return(0);
1883  if(t->toc_entry->volid == NULL)
1884  return(0);
1885  *start_lba= t->toc_entry->start_lba;
1886  *image_blocks= t->toc_entry->track_blocks;
1887  strncpy(volid, t->toc_entry->volid, 32);
1888  volid[32]= 0;
1889  return(1);
1890 }
char * volid
Definition: isoburn.h:32

References isoburn_toc_entry::start_lba, isoburn_toc_track::toc_entry, isoburn_toc_entry::track_blocks, and isoburn_toc_entry::volid.

Referenced by isoburn_set_msc1(), and Xorriso_toc().