Go to the source code of this file.
Defines | |
#define | isoburn_libisofs_req_major 0 |
The minimum version of libisofs to be used with this version of libisoburn at compile time. | |
#define | isoburn_libisofs_req_minor 6 |
#define | isoburn_libisofs_req_micro 32 |
#define | isoburn_libburn_req_major 0 |
The minimum version of libburn to be used with this version of libisoburn at compile time. | |
#define | isoburn_libburn_req_minor 7 |
#define | isoburn_libburn_req_micro 8 |
#define | isoburn_header_version_major 0 |
These three release version numbers tell the revision of this header file and of the API it describes. | |
#define | isoburn_header_version_minor 5 |
#define | isoburn_header_version_micro 6 |
#define | isoburn_ropt_norock 1 |
Which existing ISO 9660 extensions in the image to read or not to read. | |
#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_has_rockridge 1 |
After calling function isoburn_read_image() there are informations available in the option set. | |
#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. | |
#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_omit_version_numbers 1 |
Relaxed constraints. | |
#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_sort_files_by_weight 1 |
Whether and how files should be sorted. | |
Functions | |
int | isoburn_initialize (char msg[1024], int flag) |
Overview. | |
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. | |
void | isoburn_version (int *major, int *minor, int *micro) |
Obtain the three release version numbers of the library. | |
int | isoburn_libisofs_req (int *major, int *minor, int *micro) |
The minimum version of libisofs to be used with this version of libisoburn at runtime. | |
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. | |
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. | |
int | isoburn_drive_scan_and_grab (struct burn_drive_info *drive_infos[], char *adr, int load) |
Aquire a target drive by its filesystem path resp. | |
int | isoburn_drive_aquire (struct burn_drive_info *drive_infos[], char *adr, int flag) |
Aquire a target drive by its filesystem path resp. | |
int | isoburn_drive_grab (struct burn_drive *drive, int load) |
Aquire a drive from the burn_drive_info[] array which was obtained by a previous call of burn_drive_scan(). | |
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. | |
enum burn_disc_status | isoburn_disc_get_status (struct burn_drive *drive) |
Inquire the media status. | |
int | isoburn_disc_erasable (struct burn_drive *d) |
Tells whether the media can be treated by isoburn_disc_erase(). | |
void | isoburn_disc_erase (struct burn_drive *drive, int fast) |
Mark the media as blank. | |
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. | |
struct isoburn_toc_disc * | isoburn_toc_drive_get_disc (struct burn_drive *d) |
Obtain a master handle for the table of content. | |
int | isoburn_toc_disc_get_sectors (struct isoburn_toc_disc *disc) |
Tell the number of 2048 byte blocks covered by the table of content. | |
struct isoburn_toc_session ** | isoburn_toc_disc_get_sessions (struct isoburn_toc_disc *disc, int *num) |
Get the array of session handles from the table of content. | |
int | isoburn_toc_session_get_sectors (struct isoburn_toc_session *s) |
Tell the number of 2048 byte blocks covered by a particular session. | |
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. | |
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. | |
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. | |
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. | |
void | isoburn_toc_disc_free (struct isoburn_toc_disc *disc) |
Release the memory associated with a master handle of media. | |
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. | |
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. | |
int | isoburn_ropt_new (struct isoburn_read_opts **o, int flag) |
Produces a set of image read options, initialized with default values. | |
int | isoburn_ropt_destroy (struct isoburn_read_opts **o, int flag) |
Deletes an option set which was created by isoburn_ropt_new(). | |
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. | |
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. | |
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. | |
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. | |
int | isoburn_ropt_get_auto_incharset (struct isoburn_read_opts *o, int *mode) |
int | isoburn_ropt_get_size_what (struct isoburn_read_opts *o, uint32_t *size, int *has_what) |
int | isoburn_igopt_new (struct isoburn_imgen_opts **o, int flag) |
Produces a set of generation and transfer options, initialized with default values. | |
int | isoburn_igopt_destroy (struct isoburn_imgen_opts **o, int flag) |
Deletes an option set which was created by isoburn_igopt_new(). | |
int | isoburn_igopt_set_level (struct isoburn_imgen_opts *o, int level) |
ISO level to write at. | |
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_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. | |
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. | |
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 charcter set to use for representing filenames in the image. | |
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. | |
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 media. | |
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. | |
int | isoburn_igopt_set_scdbackup_tag (struct isoburn_imgen_opts *o, char *name, char *timestamp, char *tag_written) |
Set resp. | |
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. | |
int | isoburn_igopt_get_system_area (struct isoburn_imgen_opts *o, char data[32768], int *options) |
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) |
Explicitely set the four timestamps of the emerging ISO image. | |
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]) |
IsoImage * | isoburn_get_attached_image (struct burn_drive *d) |
Get the image attached to a drive, if any. | |
int | isoburn_read_image (struct burn_drive *d, struct isoburn_read_opts *read_opts, IsoImage **image) |
Load the ISO filesystem directory tree from the media in the given drive. | |
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. | |
int | isoburn_attach_image (struct burn_drive *d, IsoImage *image) |
Set the IsoImage to be used with a drive. | |
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 media. | |
int | isoburn_disc_get_msc1 (struct burn_drive *d, int *start_lba) |
Obtain the start block number of the most recent session on media. | |
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. | |
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 overwriteable media. | |
int | isoburn_prepare_disc (struct burn_drive *drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts) |
To choose the expansion 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 media from where the image was eventually loaded. | |
int | isoburn_prepare_new_image (struct burn_drive *in_drive, struct burn_disc **disc, struct isoburn_imgen_opts *opts, struct burn_drive *out_drive) |
To choose the expansion method of Modifying: Create a disc object for producing a new image from a previous image plus the changes made by user. | |
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) |
To choose the expansion 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. | |
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(). | |
void | isoburn_disc_write (struct burn_write_opts *o, struct burn_disc *disc) |
Start writing of the new session. | |
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. | |
int | isoburn_drive_wrote_well (struct burn_drive *d) |
Inquire whether the most recent write run was successful. | |
int | isoburn_activate_session (struct burn_drive *d) |
Call this after isoburn_disc_write has finished and burn_drive_wrote_well() indicates success. | |
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. | |
void | isoburn_drive_release (struct burn_drive *drive, int eject) |
Release an aquired drive. | |
void | isoburn_finish (void) |
Shutdown all three libraries. | |
int | isoburn_needs_emulation (struct burn_drive *d) |
Inquire wether the media needs emulation or would be suitable for generic multi-session via libburn. |
#define isoburn_header_version_major 0 |
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.
Definition at line 262 of file libisoburn.h.
#define isoburn_header_version_micro 6 |
Definition at line 264 of file libisoburn.h.
#define isoburn_header_version_minor 5 |
Definition at line 263 of file libisoburn.h.
#define isoburn_igopt_aaip 32 |
Definition at line 951 of file libisoburn.h.
#define isoburn_igopt_aaip_susp_1_10 2048 |
Definition at line 1040 of file libisoburn.h.
#define isoburn_igopt_allow_deep_paths 2 |
Definition at line 1030 of file libisoburn.h.
#define isoburn_igopt_allow_full_ascii 64 |
Definition at line 1035 of file libisoburn.h.
#define isoburn_igopt_allow_longer_paths 4 |
Definition at line 1031 of file libisoburn.h.
#define isoburn_igopt_allow_lowercase 32 |
Definition at line 1034 of file libisoburn.h.
#define isoburn_igopt_always_gmt 256 |
Definition at line 1037 of file libisoburn.h.
#define isoburn_igopt_dir_rec_mtime 1024 |
Definition at line 1039 of file libisoburn.h.
#define isoburn_igopt_file_md5 128 |
Definition at line 953 of file libisoburn.h.
#define isoburn_igopt_file_stability 256 |
Definition at line 954 of file libisoburn.h.
#define isoburn_igopt_hardlinks 8 |
Definition at line 950 of file libisoburn.h.
#define isoburn_igopt_iso1999 4 |
Definition at line 949 of file libisoburn.h.
#define isoburn_igopt_joliet 2 |
Definition at line 948 of file libisoburn.h.
#define isoburn_igopt_joliet_longer_paths 128 |
Definition at line 1036 of file libisoburn.h.
#define isoburn_igopt_max_37_char_filenames 8 |
Definition at line 1032 of file libisoburn.h.
#define isoburn_igopt_no_force_dots 16 |
Definition at line 1033 of file libisoburn.h.
#define isoburn_igopt_no_j_force_dots 8192 |
Definition at line 1042 of file libisoburn.h.
#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.
o | The option set to work on | |
relax | Bitfield: 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. |
Definition at line 1029 of file libisoburn.h.
#define isoburn_igopt_only_iso_versions 4096 |
Definition at line 1041 of file libisoburn.h.
#define isoburn_igopt_rockridge 1 |
Which extensions to support.
o | The option set to work on | |
ext | Bitfield: 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 |
Definition at line 947 of file libisoburn.h.
#define isoburn_igopt_rrip_version_1_10 512 |
Definition at line 1038 of file libisoburn.h.
#define isoburn_igopt_session_md5 64 |
Definition at line 952 of file libisoburn.h.
#define isoburn_igopt_sort_files_by_weight 1 |
Whether and how files should be sorted.
o | The option set to work on | |
value | Bitfield: 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(). |
Definition at line 1056 of file libisoburn.h.
#define isoburn_libburn_req_major 0 |
The minimum version of libburn to be used with this version of libisoburn at compile time.
Definition at line 226 of file libisoburn.h.
#define isoburn_libburn_req_micro 8 |
Definition at line 228 of file libisoburn.h.
#define isoburn_libburn_req_minor 7 |
Definition at line 227 of file libisoburn.h.
#define isoburn_libisofs_req_major 0 |
The minimum version of libisofs to be used with this version of libisoburn at compile time.
Definition at line 218 of file libisoburn.h.
Referenced by isoburn_initialize().
#define isoburn_libisofs_req_micro 32 |
Definition at line 220 of file libisoburn.h.
Referenced by isoburn_initialize().
#define isoburn_libisofs_req_minor 6 |
Definition at line 219 of file libisoburn.h.
Referenced by isoburn_initialize().
#define isoburn_ropt_has_el_torito 8 |
Definition at line 848 of file libisoburn.h.
#define isoburn_ropt_has_iso1999 4 |
Definition at line 847 of file libisoburn.h.
#define isoburn_ropt_has_joliet 2 |
Definition at line 846 of file libisoburn.h.
#define isoburn_ropt_has_rockridge 1 |
After calling function isoburn_read_image() there are informations available in the option set.
This info can be obtained as bits in parameter has_what. Like: joliet_available = (has_what & isoburn_ropt_has_joliet);
o | The option set to work on | |
size | Number of image data blocks, 2048 bytes each. | |
has_what | Bitfield: bit0= has_rockridge RockRidge extension info is available (POSIX filesystem) bit1= has_joliet Joliet extension info is available (suitable for MS-Windows) bit2= has_iso1999 ISO version 2 Enhanced Volume Descriptor is available. This is rather exotic. bit3= has_el_torito El-Torito boot record is present |
Definition at line 845 of file libisoburn.h.
#define isoburn_ropt_noaaip 32 |
Definition at line 754 of file libisoburn.h.
#define isoburn_ropt_noacl 64 |
Definition at line 755 of file libisoburn.h.
#define isoburn_ropt_noea 128 |
Definition at line 756 of file libisoburn.h.
#define isoburn_ropt_noino 256 |
Definition at line 757 of file libisoburn.h.
#define isoburn_ropt_noiso1999 4 |
Definition at line 751 of file libisoburn.h.
#define isoburn_ropt_nojoliet 2 |
Definition at line 750 of file libisoburn.h.
#define isoburn_ropt_nomd5 512 |
Definition at line 758 of file libisoburn.h.
#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 | resp. inquired by &.
ext | Bitfield: 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 |
Definition at line 749 of file libisoburn.h.
#define isoburn_ropt_preferjoliet 8 |
Definition at line 752 of file libisoburn.h.
#define isoburn_ropt_pretend_blank 16 |
Definition at line 753 of file libisoburn.h.
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.
d | The output drive to which the session was written |
Definition at line 278 of file isofs_wrap.c.
References isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn::fabricated_msc2, isoburn_find_emulator(), Libisoburn_target_head_sizE, isoburn::target_iso_head, and isoburn::zero_nwa.
Referenced by isoburn_invalidate_iso().
{ int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, drive, 0); if (ret < 0) return -1; if (o->emulation_mode != 1) return 1; /* don't need to activate session */ if (o->fabricated_msc2 >= 0) return 1; /* blind growing: do not alter anything outside the session */ if (!(o->fabricated_disc_status == BURN_DISC_APPENDABLE || (o->fabricated_disc_status == BURN_DISC_BLANK && o->zero_nwa > 0))) return 1; ret = burn_random_access_write(drive, (off_t) 0, (char*)o->target_iso_head, Libisoburn_target_head_sizE, 1); return ret; }
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 media. 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.
d | The drive which shall be write target of the volset. | |
image | The 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. |
Definition at line 255 of file isofs_wrap.c.
References isoburn::image, isoburn_find_emulator(), and isoburn_msgs_submit().
{ int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, d, 0); if (ret < 0 || o == NULL) return 0; if (image == NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_attach_image: image==NULL", 0, "FATAL", 0); return -1; } if(o->image != NULL) iso_image_unref(o->image); o->image = image; return(1); }
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.
input_drive | The drive resp. in_drive which was used with the preparation call. | |
output_drive | The out_drive used with isoburn_prepare_new_image(), NULL if none. | |
flag | Bitfield, submit 0 for now. bit0= -reserved for internal use- |
Definition at line 584 of file isoburn.c.
References isoburn::iso_source, and isoburn_find_emulator().
Referenced by isoburn_sync_after_write().
{ int ret; struct isoburn *o= NULL; if(output_drive!=NULL) { ret= isoburn_find_emulator(&o, output_drive, 0); if(ret<0 || o==NULL) o= NULL; else if(o->iso_source==NULL) o= NULL; } if(o==NULL) { ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(0); if(o->iso_source==NULL) return(0); } if(o->iso_source->read!=NULL) return(0); if(o->iso_source->version<1) return(0); o->iso_source->cancel(o->iso_source); burn_source_free(o->iso_source); o->iso_source= NULL; return(1); }
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 media.
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()
d | The drive to query. | |
o | If not NULL: write parameters to be set on drive before query |
Definition at line 608 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn_disc_get_status(), isoburn_find_emulator(), and isoburn::nwa.
{ int ret; struct isoburn *o; struct burn_write_opts *eff_opts= NULL, *local_opts= NULL; enum burn_disc_status s; off_t avail; eff_opts= opts; ret= isoburn_find_emulator(&o, d, 0); if(ret>0 && o!=NULL) if(o->emulation_mode!=0) { s= isoburn_disc_get_status(d); if(s==BURN_DISC_FULL) /* unknown data format in first 64 kB */ return((off_t) 0); local_opts= burn_write_opts_new(d); eff_opts= local_opts; burn_write_opts_set_start_byte(eff_opts, ((off_t) o->nwa) * (off_t) 2048); } avail= burn_disc_available_space(d, eff_opts); if(local_opts!=NULL) burn_write_opts_free(local_opts); local_opts= NULL; return(avail); }
int isoburn_disc_erasable | ( | struct burn_drive * | d | ) |
Tells whether the media can be treated by isoburn_disc_erase().
Wrapper for: burn_disc_erasable()
d | The drive to inquire. |
Definition at line 553 of file burn_wrap.c.
References isoburn::emulation_mode, and isoburn_find_emulator().
{ int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret>0) if(o->emulation_mode==1) return(1); return burn_disc_erasable(d); }
void isoburn_disc_erase | ( | struct burn_drive * | drive, | |
int | fast | |||
) |
Mark the media 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 media. In case of success, the media is in status BURN_DISC_BLANK afterwards. Wrapper for: burn_disc_erase()
drive | The drive with the media to erase. | |
fast | 1=fast erase, 0=thorough erase With DVD-RW, fast erase yields media incapable of multi-session. |
Definition at line 566 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn_disc_get_status(), isoburn_find_emulator(), isoburn_invalidate_iso(), and Libisoburn_target_head_sizE.
{ int ret, do_pseudo_blank= 0; struct isoburn *o; enum burn_disc_status s; char zero_buffer[Libisoburn_target_head_sizE]; struct burn_multi_caps *caps= NULL; ret= isoburn_find_emulator(&o, drive, 0); if(ret>0) { if(o->emulation_mode==-1) { /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); goto ex; } if(o->emulation_mode > 0) { /* might be readonly with emulated sessions */ ret= burn_disc_get_multi_caps(drive, BURN_WRITE_NONE, &caps, 0); if(ret > 0 && caps->start_adr) do_pseudo_blank= 1; } if(do_pseudo_blank) { s= isoburn_disc_get_status(drive); if(s==BURN_DISC_FULL) { /* unknown data format in first 64 kB */ memset(zero_buffer, 0, Libisoburn_target_head_sizE); ret= burn_random_access_write(drive, (off_t) 0, zero_buffer, (off_t) Libisoburn_target_head_sizE, 1); } else { ret= isoburn_invalidate_iso(o, 0); } if(ret<=0) burn_drive_cancel(drive); /* mark run as failure */ goto ex; } } burn_disc_erase(drive, fast); ex:; if(caps!=NULL) burn_disc_free_multi_caps(&caps); }
int isoburn_disc_get_msc1 | ( | struct burn_drive * | d, | |
int * | start_lba | |||
) |
Obtain the start block number of the most recent session on media.
In case of random access media this will normally be 0. Successfull 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()
d | The drive to inquire | |
start_lba | Contains on success the start address in 2048 byte blocks |
Definition at line 636 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn::fabricated_msc1, isoburn_disc_get_status(), isoburn_find_emulator(), and isoburn_msgs_submit().
Referenced by isoburn_read_image().
{ int ret; struct isoburn *o; #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ *start_lba= Hardcoded_cd_rw_c1; return(1); #endif if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE && isoburn_disc_get_status(d)!=BURN_DISC_FULL) { isoburn_msgs_submit(NULL, 0x00060000, "Media contains no recognizable data", 0, "SORRY", 0); return(0); } ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(0); if(o->fabricated_msc1>=0) { *start_lba= o->fabricated_msc1; return(1); } if(ret>0) if(o->emulation_mode>0) { *start_lba= 0; return(1); } return(burn_disc_get_msc1(d, start_lba)); }
enum burn_disc_status isoburn_disc_get_status | ( | struct burn_drive * | drive | ) |
Inquire the media 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()
drive | The drive to inquire. |
Definition at line 530 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn_find_emulator(), isoburn::nwa, and isoburn::zero_nwa.
Referenced by isoburn_disc_available_space(), isoburn_disc_erase(), isoburn_disc_get_msc1(), isoburn_is_intermediate_dvd_rw(), isoburn_needs_emulation(), isoburn_prepare_disc_aux(), and isoburn_read_image().
{ int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return(BURN_DISC_UNSUITABLE); if(o!=NULL) if(o->fabricated_disc_status!=BURN_DISC_UNREADY) return(o->fabricated_disc_status); if(ret==0) return(burn_disc_get_status(drive)); /* emulated status */ if(o->emulation_mode==-1) return(BURN_DISC_UNSUITABLE); if(o->nwa>o->zero_nwa) return(BURN_DISC_APPENDABLE); return(BURN_DISC_BLANK); }
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()
d | The drive to inquire | |
o | If not NULL: write parameters to be set on drive before query | |
trackno | Submit 0. | |
lba | return value: start lba | |
nwa | return value: Next Writeable Address |
Definition at line 668 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn_find_emulator(), and isoburn::nwa.
Referenced by isoburn_get_msc2(), and isoburn_prepare_disc_aux().
{ int ret; struct isoburn *o; #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ *lba= Hardcoded_cd_rw_c1; *nwa= Hardcoded_cd_rw_nwA; return(1); #endif *nwa= *lba= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(0); if(ret>0) if(o->emulation_mode>0) { *lba= 0; *nwa= o->nwa; return(1); } if(burn_drive_get_drive_role(d) != 1) return(1); return(burn_disc_track_lba_nwa(d, opts, trackno, lba, nwa)); }
void isoburn_disc_write | ( | struct burn_write_opts * | o, | |
struct burn_disc * | disc | |||
) |
Start writing of the new session.
This call is asynchrounous. 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()
o | Options which control the burn process. See burnwrite_opts_*() in libburn.h. | |
disc | Disc object created either by isoburn_prepare_disc() or by isoburn_prepare_new_image(). |
Definition at line 714 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn_find_emulator(), isoburn_is_intermediate_dvd_rw(), isoburn_msgs_submit(), isoburn::nwa, isoburn::truncate, and isoburn::wrote_well.
{ int ret; off_t nwa= 0; struct isoburn *o; struct burn_drive *drive; char reasons[BURN_REASONS_LEN],msg[160+BURN_REASONS_LEN]; char adr[BURN_DRIVE_ADR_LEN]; enum burn_write_types write_type; struct stat stbuf; drive= burn_write_opts_get_drive(opts); ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return; if(o!=NULL) { o->wrote_well= -1; if(o->emulation_mode!=0) { burn_write_opts_set_multi(opts, 0); if(o->emulation_mode>0 && o->nwa >= 0) { nwa= o->nwa; /* This caters for unwritten formatted DVD-RW. They need to be written sequentially on the first use. Only written areas are random access. If the first session is not written to LBA 0, then re-opening of formatting and padding is needed. This can be done. But when the track gets closed after padding, this lasts a long time. There is a high risk that an app will not poll the message queue while waiting for isoburn_disc_write() to return. The pacifier loop usually happens only afterwards. So automatic formatting might cause a nervous clueless user. */ ret= isoburn_is_intermediate_dvd_rw(drive, 0); if(ret>0 && nwa>0 && nwa <= o->zero_nwa) { /* actually this should not happen since such media get recognized by isoburn_welcome_media and o->zero_nwa gets set to 0 */ sprintf(msg, "DVD-RW insufficiently formatted. (Intermediate State, size unknown)"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); sprintf(msg, "It might help to first deformat it and then format it again"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "HINT", 0); burn_drive_cancel(drive); /* mark run as failure */ return; } /* end of DVD-RW oriented check */ burn_write_opts_set_start_byte(opts, nwa * (off_t) 2048); } } } write_type= burn_write_opts_auto_write_type(opts, disc, reasons, 0); if (write_type == BURN_WRITE_NONE) { sprintf(msg, "Failed to find a suitable write mode:\n%s", reasons); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); if(o!=NULL) o->wrote_well= 0; /* To cause a negative reply with burn_drive_wrote_well() */ burn_drive_cancel(drive); return; } sprintf(reasons, "%d", (int) write_type); sprintf(msg, "Write_type = %s\n", (write_type == BURN_WRITE_SAO ? "SAO" : (write_type == BURN_WRITE_TAO ? "TAO" : reasons))); isoburn_msgs_submit(o, 0x00060000, msg, 0, "DEBUG", 0); #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ fprintf(stderr, "Setting write address to LBA %d\n", Hardcoded_cd_rw_nwA); burn_write_opts_set_start_byte(opts, ((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048); #endif if(o->truncate) { ret= burn_drive_get_drive_role(drive); if(ret==2) { ret= burn_drive_d_get_adr(drive, adr); if(ret>0) { ret= lstat(adr, &stbuf); if(ret!=-1) if(S_ISREG(stbuf.st_mode)) truncate(adr, nwa * (off_t) 2048); } } } burn_disc_write(opts, disc); }
int isoburn_drive_aquire | ( | struct burn_drive_info * | drive_infos[], | |
char * | adr, | |||
int | flag | |||
) |
Aquire a target drive by its filesystem path resp.
libburn persistent address. This is a modern successor of isoburn_drive_scan_and_grab(). Wrapper for: burn_drive_scan_and_grab()
drive_infos | On 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). | |
adr | The persistent address of the desired drive. | |
flag | bit0= attempt to load the disc tray. Else: failure if not loaded. bit1= regard overwriteable 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 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 overwriteable media bit5= ignore ACL from external filesystems bit6= ignore POSIX Extended Attributes from external filesystems bit7= pretend read-only profile and scan for table of content |
flag | bit0= load bit1= regard overwriteable 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 overwriteable 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 |
Definition at line 428 of file burn_wrap.c.
References isoburn::drive, isoburn_destroy(), isoburn_find_emulator(), isoburn_welcome_media(), and isoburn::truncate.
Referenced by isoburn_drive_scan_and_grab().
{ int ret, drive_grabbed= 0; struct isoburn *o= NULL; #ifndef NIX /* <<< should be obsolete by new drive addressing of libburn-0.5.2 */ /* >>> but helps with kernel 2.4 to use /dev/sr */ int conv_ret; char libburn_drive_adr[BURN_DRIVE_ADR_LEN]; conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr); if(conv_ret<=0) strcpy(libburn_drive_adr, adr); ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1); #else ret= burn_drive_scan_and_grab(drive_infos, adr, flag & 1); #endif /* ! NIX */ if(ret<=0) goto ex; drive_grabbed= 1; ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive, (flag & (8 | 16 | 32 | 64 | 128)) | !!(flag&2)); if(ret<=0) goto ex; if(flag&4) { ret= isoburn_find_emulator(&o, (*drive_infos)[0].drive, 0); if(ret>0 && o!=NULL) o->truncate= 1; } ret= 1; ex: if(ret<=0) { if(drive_grabbed) burn_drive_release((*drive_infos)[0].drive, 0); isoburn_destroy(&o, 0); } return(ret); }
int isoburn_drive_grab | ( | struct burn_drive * | drive, | |
int | load | |||
) |
Aquire a drive from the burn_drive_info[] array which was obtained by a previous call of burn_drive_scan().
Wrapper for: burn_drive_grab()
drive | The drive to grab. E.g. drive_infos[1].drive . Call isoburn_drive_release(drive) when it it no longer needed. | |
load | 1 attempt to load the disc tray. 0 no attempt, rather failure. |
Definition at line 488 of file burn_wrap.c.
References isoburn_destroy(), and isoburn_welcome_media().
{ int ret; struct isoburn *o= NULL; ret= burn_drive_grab(drive, load); if(ret<=0) goto ex; ret= isoburn_welcome_media(&o, drive, 0); if(ret<=0) goto ex; ret= 1; ex: if(ret<=0) isoburn_destroy(&o,0); return(ret); }
void isoburn_drive_release | ( | struct burn_drive * | drive, | |
int | eject | |||
) |
Release an aquired drive.
Wrapper for: burn_drive_release()
drive | The drive to be released | |
eject | 1= eject media from drive , 0= do not eject |
Definition at line 808 of file burn_wrap.c.
References isoburn_destroy(), and isoburn_find_emulator().
{ int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return; if(o!=NULL) { isoburn_destroy(&o, 0); } burn_drive_release(drive, eject); }
int isoburn_drive_scan_and_grab | ( | struct burn_drive_info * | drive_infos[], | |
char * | adr, | |||
int | load | |||
) |
Aquire a target drive by its filesystem path resp.
libburn persistent address. Wrapper for: burn_drive_scan_and_grab()
drive_infos | On 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). | |
adr | The persistent address of the desired drive. | |
load | 1 attempt to load the disc tray. 0 no attempt,rather failure. |
Definition at line 478 of file burn_wrap.c.
References isoburn_drive_aquire().
{ int ret; ret= isoburn_drive_aquire(drive_infos, adr, !!load); return(ret); }
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.
d | The drive to which this function, handle and flag shall apply | |
msgs_submit | The function call which implements the method | |
submit_handle | Handle to be used as first argument of msgs_submit | |
submit_flag | Flag to be used as last argument of msgs_submit | |
flag | Unused yet, submit 0 |
Definition at line 1617 of file burn_wrap.c.
References isoburn_find_emulator(), isoburn::msgs_submit, isoburn::msgs_submit_flag, and isoburn::msgs_submit_handle.
{ struct isoburn *o; int ret; ret= isoburn_find_emulator(&o, d, 0); if(ret<0 || o==NULL) return(-1); o->msgs_submit= msgs_submit; o->msgs_submit_handle= submit_handle; o->msgs_submit_flag= submit_flag; return(1); }
int isoburn_drive_wrote_well | ( | struct burn_drive * | d | ) |
Inquire whether the most recent write run was successful.
Wrapper for: burn_drive_wrote_well()
d | The drive to inquire |
Definition at line 899 of file burn_wrap.c.
References isoburn_find_emulator(), and isoburn::wrote_well.
{ int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o!=NULL) if(o->wrote_well>=0) return(o->wrote_well); ret= burn_drive_wrote_well(d); return ret; }
void isoburn_finish | ( | void | ) |
Shutdown all three libraries.
Wrapper for : iso_finish() and burn_finish().
Definition at line 823 of file burn_wrap.c.
References isoburn_destroy_all().
{ isoburn_destroy_all(&isoburn_list_start, 0); burn_finish(); iso_finish(); }
IsoImage* isoburn_get_attached_image | ( | struct burn_drive * | d | ) |
Get the image attached to a drive, if any.
d | The drive to inquire |
Definition at line 88 of file isofs_wrap.c.
References isoburn::image, and isoburn_find_emulator().
{ int ret; struct isoburn *o= NULL; ret = isoburn_find_emulator(&o, d, 0); if (ret < 0) return NULL; if (o == NULL) { return NULL; } iso_image_ref(o->image); return o->image; }
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().
d | The drive to which the track with the fifo gets burned. | |
size | The total size of the fifo | |
free_bytes | The current free capacity of the fifo | |
status_text | Returns a pointer to a constant text, see below |
Definition at line 915 of file burn_wrap.c.
References isoburn::iso_source, and isoburn_find_emulator().
{ int ret; struct isoburn *o; size_t hsize= 0, hfree_bytes= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(-1); if(o->iso_source==NULL) return(-1); ret= iso_ring_buffer_get_status(o->iso_source, &hsize, &hfree_bytes); if(hsize > 1024*1024*1024) *size= 1024*1024*1024; else *size= hsize; if(hfree_bytes > 1024*1024*1024) *free_bytes= 1024*1024*1024; else *free_bytes= hfree_bytes; *status_text= ""; if(ret==0) *status_text= "standby"; else if(ret==1) *status_text= "active"; else if(ret==2) *status_text= "ending"; else if(ret==3) *status_text= "failing"; else if(ret==4) *status_text= "unused"; else if(ret==5) *status_text= "abandoned"; else if(ret==6) *status_text= "ended"; else if(ret==7) *status_text= "aborted"; return(ret); }
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 overwriteable media.
This value is supposed to be <= 2048 * nwa as of isoburn_disc_track_lba_nwa().
d | The drive holding the media. | |
start_byte | The reply value counted in bytes, not in sectors. | |
flag | Unused yet. Submit 0. |
Definition at line 881 of file burn_wrap.c.
References isoburn_find_emulator(), and isoburn::min_start_byte.
{ int ret; struct isoburn *o; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(ret==0) return(0); *start_byte= o->min_start_byte; if(o->min_start_byte<=0) return(0); return(1); }
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.
d | The drive where msc1 is to be set | |
adr_mode | Determines 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_value | A string describing the value to be eventually used. | |
lba | returns the block address of the entity, -1 means invalid | |
track | returns the track number of the entity, -1 means invalid | |
session | returns the session number of the entity, -1 means invalid | |
volid | returns the volume id of the entity if it is a ISO session | |
flag | Bitfield for control purposes. bit2= with adr_mode 4: use adr_value as regular expression |
Definition at line 1792 of file burn_wrap.c.
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_get_sessions(), isoburn_toc_drive_get_disc(), and isoburn_toc_session_get_tracks().
{ int msc1_mem, ret, total_tracks, num_sessions, num_tracks, i, j, track_lba; int size, is_iso= 0; struct isoburn *o; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions= NULL; struct isoburn_toc_track **tracks= NULL; *lba= *track= *session= -1; volid[0]= 0; ret= isoburn_find_emulator(&o, d, 0); if(ret < 0 || o == NULL) return(-1); msc1_mem= o->fabricated_msc1; ret= isoburn_set_msc1(d, adr_mode, adr_value, 2 | (flag & 4)); if(ret <= 0) return(ret); *lba= o->fabricated_msc1; disc= isoburn_toc_drive_get_disc(d); if(disc==NULL) {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */ sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); if(sessions==NULL || num_sessions<=0) {ret= -1; goto ex;} /* cannot happen because checked by isoburn_set_msc1 */ total_tracks= 0; for(i=0; i<num_sessions && *session < 0; i++) { tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks); if(tracks==NULL) continue; for(j= 0; j<num_tracks && *track < 0; j++) { total_tracks++; isoburn_get_track_lba(tracks[j], &track_lba, 0); if(track_lba == *lba) { *track= total_tracks; *session= i + 1; } } } ret= isoburn_read_iso_head(d, *lba, &size, volid, 1); if(ret <= 0) volid[0]= 0; else is_iso= 1; ex:; o->fabricated_msc1= msc1_mem; return(2 - is_iso); }
int isoburn_igopt_destroy | ( | struct isoburn_imgen_opts ** | o, | |
int | flag | |||
) |
Deletes an option set which was created by isoburn_igopt_new().
o | The option set to give up | |
flag | Bitfield for control purposes. Submit 0 for now. |
Definition at line 874 of file isoburn.c.
{ if(*o==NULL) return(0); free(*o); *o= NULL; return(1); }
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.
o | The option set to work on | |
lba | The block number of the session start on media. <0 means that no address has been determined yet. |
Definition at line 1050 of file isoburn.c.
References isoburn_imgen_opts::data_start_lba.
{ *lba= o->data_start_lba; return(1); }
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 media.
This value cannot be set by the application but only be inquired.
o | The option set to work on | |
lba | The block number of the session start on media. <0 means that no address has been determined yet. |
Definition at line 1043 of file isoburn.c.
References isoburn_imgen_opts::effective_lba.
{ *lba= o->effective_lba; return(1); }
int isoburn_igopt_get_extensions | ( | struct isoburn_imgen_opts * | o, | |
int * | ext | |||
) |
Definition at line 911 of file isoburn.c.
References isoburn_imgen_opts::aaip, isoburn_imgen_opts::file_md5, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::iso1999, isoburn_imgen_opts::joliet, isoburn_imgen_opts::rockridge, and isoburn_imgen_opts::session_md5.
int isoburn_igopt_get_fifo_size | ( | struct isoburn_imgen_opts * | o, | |
int * | fifo_size | |||
) |
Definition at line 1036 of file isoburn.c.
References isoburn_imgen_opts::fifo_size.
{ *fifo_size= o->fifo_size; return(1); }
int isoburn_igopt_get_level | ( | struct isoburn_imgen_opts * | o, | |
int * | level | |||
) |
Definition at line 891 of file isoburn.c.
References isoburn_imgen_opts::level.
{ *level= o->level; return(1); }
int isoburn_igopt_get_out_charset | ( | struct isoburn_imgen_opts * | o, | |
char ** | output_charset | |||
) |
Definition at line 1021 of file isoburn.c.
References isoburn_imgen_opts::output_charset.
{ *output_charset= o->output_charset; return(1); }
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 978 of file isoburn.c.
References isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::replace_dir_mode, and isoburn_imgen_opts::replace_file_mode.
{ *replace_dir_mode= o->replace_dir_mode%3; *replace_file_mode= o->replace_file_mode%3; *dir_mode= o->dir_mode; *file_mode= o->file_mode; return(1); }
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 1001 of file isoburn.c.
References isoburn_imgen_opts::gid, isoburn_imgen_opts::replace_gid, isoburn_imgen_opts::replace_uid, and isoburn_imgen_opts::uid.
{ *replace_uid= o->replace_uid%3; *replace_gid= o->replace_gid%3; *uid= o->uid; *gid= o->gid; return(1); }
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 1130 of file isoburn.c.
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.
{ *vol_creation_time = opts->vol_creation_time; *vol_modification_time = opts->vol_modification_time; *vol_expiration_time = opts->vol_expiration_time; *vol_effective_time = opts->vol_effective_time; strcpy(vol_uuid, opts->vol_uuid); return(1); }
int isoburn_igopt_get_relaxed | ( | struct isoburn_imgen_opts * | o, | |
int * | relax | |||
) |
Definition at line 940 of file isoburn.c.
References isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_deep_paths, 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::joliet_longer_paths, 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.
{ *relax= (!!o->omit_version_numbers) | ((!!o->allow_deep_paths)<<1) | ((!!o->allow_longer_paths)<<2) | ((!!o->max_37_char_filenames)<<3) | ((!!o->no_force_dots)<<4) | ((!!o->allow_lowercase)<<5) | ((!!o->allow_full_ascii)<<6) | ((!!o->joliet_longer_paths)<<7) | ((!!o->always_gmt)<<8) | ((!!o->rrip_version_1_10)<<9) | ((!!o->dir_rec_mtime)<<10) | ((!!o->aaip_susp_1_10)<<11); return(1); }
int isoburn_igopt_get_scdbackup_tag | ( | struct isoburn_imgen_opts * | o, | |
char | name[81], | |||
char | timestamp[19], | |||
char ** | tag_written | |||
) |
Definition at line 1071 of file isoburn.c.
References isoburn_imgen_opts::scdbackup_tag_name, isoburn_imgen_opts::scdbackup_tag_time, and isoburn_imgen_opts::scdbackup_tag_written.
{ strncpy(name, o->scdbackup_tag_name, 80); name[80]= 0; strncpy(timestamp, o->scdbackup_tag_time, 18); timestamp[18]= 0; *tag_written= o->scdbackup_tag_written; return(1); }
int isoburn_igopt_get_sort_files | ( | struct isoburn_imgen_opts * | o, | |
int * | value | |||
) |
Definition at line 959 of file isoburn.c.
References isoburn_imgen_opts::sort_files.
{ *value= !!o->sort_files; return(1); }
int isoburn_igopt_get_system_area | ( | struct isoburn_imgen_opts * | o, | |
char | data[32768], | |||
int * | options | |||
) |
Definition at line 1104 of file isoburn.c.
References isoburn_imgen_opts::system_area_data, and isoburn_imgen_opts::system_area_options.
{ *options= opts->system_area_options; if(opts->system_area_data == NULL) return(0); memcpy(data, opts->system_area_data, 32768); return(1); }
int isoburn_igopt_new | ( | struct isoburn_imgen_opts ** | o, | |
int | flag | |||
) |
Produces a set of generation and transfer options, initialized with default values.
o | the newly created option set object | |
flag | Bitfield for control purposes. Submit 0 for now. |
Definition at line 822 of file isoburn.c.
References isoburn_imgen_opts::aaip, isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_deep_paths, 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::data_start_lba, isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::dir_rec_mtime, isoburn_imgen_opts::effective_lba, isoburn_imgen_opts::fifo_size, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::gid, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::iso1999, isoburn_msgs_submit(), isoburn_imgen_opts::joliet, isoburn_imgen_opts::joliet_longer_paths, isoburn_imgen_opts::level, isoburn_imgen_opts::max_37_char_filenames, isoburn_imgen_opts::no_force_dots, isoburn_imgen_opts::omit_version_numbers, isoburn_imgen_opts::output_charset, 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::rrip_version_1_10, isoburn_imgen_opts::sort_files, isoburn_imgen_opts::system_area_data, isoburn_imgen_opts::system_area_options, isoburn_imgen_opts::uid, 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.
{ struct isoburn_imgen_opts *o; o= (*new_o)= calloc(1, sizeof(struct isoburn_imgen_opts)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for image generation options", 0, "FATAL", 0); return(-1); } o->level= 2; o->rockridge= 1; o->joliet= 0; o->iso1999= 0; o->hardlinks= 0; o->aaip = 0; o->omit_version_numbers= 0; o->allow_deep_paths= 1; o->allow_longer_paths= 0; o->max_37_char_filenames= 0; o->no_force_dots= 0; o->allow_lowercase= 0; o->allow_full_ascii= 0; o->joliet_longer_paths= 0; o->always_gmt= 0; o->rrip_version_1_10= 0; o->dir_rec_mtime= 0; o->aaip_susp_1_10= 0; o->sort_files= 0; o->replace_dir_mode= 0; o->replace_file_mode= 0; o->replace_uid= 0; o->replace_gid= 0; o->dir_mode= 0555; o->file_mode= 0444; o->uid= 0; o->gid= 0; o->output_charset= NULL; o->fifo_size= 4*1024*1024; o->effective_lba= -1; o->data_start_lba= -1; o->system_area_data= NULL; o->system_area_options= 0; o->vol_creation_time= 0; o->vol_modification_time= 0; o->vol_expiration_time= 0; o->vol_effective_time= 0; return(1); }
int isoburn_igopt_set_extensions | ( | struct isoburn_imgen_opts * | o, | |
int | ext | |||
) |
Definition at line 898 of file isoburn.c.
References isoburn_imgen_opts::aaip, isoburn_imgen_opts::file_md5, isoburn_imgen_opts::hardlinks, isoburn_imgen_opts::iso1999, isoburn_imgen_opts::joliet, isoburn_imgen_opts::rockridge, and isoburn_imgen_opts::session_md5.
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).
o | The option set to work on | |
fifo_size | Number of bytes to use |
Definition at line 1029 of file isoburn.c.
References isoburn_imgen_opts::fifo_size.
int isoburn_igopt_set_level | ( | struct isoburn_imgen_opts * | o, | |
int | level | |||
) |
ISO level to write at.
o | The option set to work on | |
level | is 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 |
Definition at line 884 of file isoburn.c.
References isoburn_imgen_opts::level.
int isoburn_igopt_set_out_charset | ( | struct isoburn_imgen_opts * | o, | |
char * | output_charset | |||
) |
Set the charcter set to use for representing filenames in the image.
o | The option set to work on | |
output_charset | Set 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". |
Definition at line 1013 of file isoburn.c.
References isoburn_imgen_opts::output_charset.
{ o->output_charset= output_charset; return(1); }
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.
o | The option set to work on | |
replace_dir_mode | whether and how to override directories | |
replace_file_mode | whether and how to override files of other type | |
dir_mode | Mode to use on dirs with replace_dir_mode == 2. | |
file_mode; | Mode to use on files with replace_file_mode == 2. |
Definition at line 966 of file isoburn.c.
References isoburn_imgen_opts::dir_mode, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::replace_dir_mode, and isoburn_imgen_opts::replace_file_mode.
{ o->replace_dir_mode= replace_dir_mode%3; o->replace_file_mode= replace_file_mode%3; o->dir_mode= dir_mode; o->file_mode= file_mode; return(1); }
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.
o | The option set to work on | |
replace_uid | whether and how to override user ids | |
replace_gid | whether and how to override group ids | |
uid | User id to use with replace_uid == 2. | |
gid | Group id to use on files with replace_gid == 2. |
Definition at line 990 of file isoburn.c.
References isoburn_imgen_opts::gid, isoburn_imgen_opts::replace_gid, isoburn_imgen_opts::replace_uid, and isoburn_imgen_opts::uid.
{ o->replace_uid= replace_uid%3; o->replace_gid= replace_gid%3; o->uid= uid; o->gid= gid; return(1); }
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 | |||
) |
Explicitely set the four timestamps of the emerging ISO image.
Default with all parameters is 0.
creation_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_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_time | When "the information in the volume may be regarded as obsolete." A value of 0 means that the information never shall expire. | |
effective_time | When "the information in the volume may be used." A value of 0 means that not such retention is intended. | |
uuid | If 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) |
Definition at line 1115 of file isoburn.c.
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.
{ opts->vol_creation_time = vol_creation_time; opts->vol_modification_time = vol_modification_time; opts->vol_expiration_time = vol_expiration_time; opts->vol_effective_time = vol_effective_time; strncpy(opts->vol_uuid, vol_uuid, 16); opts->vol_uuid[16] = 0; return(1); }
int isoburn_igopt_set_relaxed | ( | struct isoburn_imgen_opts * | o, | |
int | relax | |||
) |
Definition at line 920 of file isoburn.c.
References isoburn_imgen_opts::aaip_susp_1_10, isoburn_imgen_opts::allow_deep_paths, 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::joliet_longer_paths, 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.
{ o->omit_version_numbers= (!!(relax&1)) | (2 * !!(relax & isoburn_igopt_only_iso_versions)); o->allow_deep_paths= !!(relax&2); o->allow_longer_paths= !!(relax&4); o->max_37_char_filenames= !!(relax&8); o->no_force_dots= (!!(relax&16)) | (2 * !!(relax & isoburn_igopt_no_j_force_dots)); o->allow_lowercase= !!(relax&32); o->allow_full_ascii= !!(relax&64); o->joliet_longer_paths= !!(relax&128); o->always_gmt= !!(relax & isoburn_igopt_always_gmt); o->rrip_version_1_10= !!(relax & isoburn_igopt_rrip_version_1_10); o->dir_rec_mtime= !!(relax & isoburn_igopt_dir_rec_mtime); o->aaip_susp_1_10= !!(relax & isoburn_igopt_aaip_susp_1_10); return(1); }
int isoburn_igopt_set_scdbackup_tag | ( | struct isoburn_imgen_opts * | o, | |
char * | name, | |||
char * | timestamp, | |||
char * | tag_written | |||
) |
Set resp.
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.
o | The option set to work on | |
name | The tag name. 80 characters max. | |
timestamp | A string of up to 13 characters YYMMDD.hhmmss A9 = 2009, B0 = 2010, B1 = 2011, ... C0 = 2020, ... | |
tag_written | Either 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. |
Definition at line 1057 of file isoburn.c.
References isoburn_imgen_opts::scdbackup_tag_name, isoburn_imgen_opts::scdbackup_tag_time, and isoburn_imgen_opts::scdbackup_tag_written.
{ strncpy(o->scdbackup_tag_name, name, 80); o->scdbackup_tag_name[80]= 0; strncpy(o->scdbackup_tag_time, timestamp, 18); o->scdbackup_tag_time[18]= 0; o->scdbackup_tag_written = tag_written; if(tag_written != NULL) tag_written[0]= 0; return(1); }
int isoburn_igopt_set_sort_files | ( | struct isoburn_imgen_opts * | o, | |
int | value | |||
) |
Definition at line 952 of file isoburn.c.
References isoburn_imgen_opts::sort_files.
{ o->sort_files= !!(value&1); return(1); }
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.
o | The option set to work on | |
data | Either NULL or 32 kB of data. Do not submit less bytes ! | |
options | Can 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. |
Definition at line 1084 of file isoburn.c.
References isoburn_imgen_opts::system_area_data, and isoburn_imgen_opts::system_area_options.
{ if (data == NULL) { /* Disable */ if (opts->system_area_data != NULL) free(opts->system_area_data); opts->system_area_data = NULL; } else { if (opts->system_area_data == NULL) { opts->system_area_data = calloc(32768, 1); if (opts->system_area_data == NULL) return(-1); } memcpy(opts->system_area_data, data, 32768); } opts->system_area_options = options & 3; return(1); }
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 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.
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 priciple 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 resp. 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 resp. 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 overwriteable 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 overwriteable 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 media 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 or take special precautions to interface with the library by 64 bit integers where above .h files prescribe off_t. Not to use 64 bit file i/o will keep the application from producing and processing ISO images of more than 2 GB size. Initialize libisoburn, libisofs and libburn. Wrapper for : iso_init() and burn_initialize()
msg | A character array for eventual messages (e.g. with errors) | |
flag | Bitfield for control purposes (unused yet, submit 0) |
Definition at line 66 of file burn_wrap.c.
References isoburn_destroy_all(), isoburn_libisofs_req_major, isoburn_libisofs_req_micro, isoburn_libisofs_req_minor, and isoburn_version().
{ int major, minor, micro, bad_match= 0; /* First two ugly compile time checks for header version compatibility. If everthing matches, then they produce no C code. In case of mismatch, intentionally faulty C code will be inserted. */ #ifdef iso_lib_header_version_major /* The minimum requirement of libisoburn towards the libisofs header at compile time is defined in libisoburn/libisoburn.h : isoburn_libisofs_req_major isoburn_libisofs_req_minor isoburn_libisofs_req_micro It gets compared against the version macros in libisofs/libisofs.h : iso_lib_header_version_major iso_lib_header_version_minor iso_lib_header_version_micro If the header is too old then the following code shall cause failure of libisoburn compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'LIBISOFS_MISCONFIGURATION' undeclared (first use in this function) 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) error: 'LIBISOFS_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indendation is an advise of man gcc to help old compilers ignoring */ #if isoburn_libisofs_req_major > iso_lib_header_version_major #define Isoburn_libisofs_dot_h_too_olD 1 #endif #if isoburn_libisofs_req_major == iso_lib_header_version_major && isoburn_libisofs_req_minor > iso_lib_header_version_minor #define Isoburn_libisofs_dot_h_too_olD 1 #endif #if isoburn_libisofs_req_minor == iso_lib_header_version_minor && isoburn_libisofs_req_micro > iso_lib_header_version_micro #define Isoburn_libisofs_dot_h_too_olD 1 #endif #ifdef Isoburn_libisofs_dot_h_too_olD LIBISOFS_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libisofs_dot_h_TOO_OLD__SEE_libisoburn_dot_h_AND_burn_wrap_dot_h = 0; LIBISOFS_MISCONFIGURATION_ = 0; #endif #endif /* iso_lib_header_version_major */ /* The minimum requirement of libisoburn towards the libburn header at compile time is defined in libisoburn/libisoburn.h : isoburn_libburn_req_major isoburn_libburn_req_minor isoburn_libburn_req_micro It gets compared against the version macros in libburn/libburn.h : burn_header_version_major burn_header_version_minor burn_header_version_micro If the header is too old then the following code shall cause failure of cdrskin compilation rather than to allow production of a program with unpredictable bugs or memory corruption. The compiler messages supposed to appear in this case are: error: 'LIBBURN_MISCONFIGURATION' undeclared (first use in this function) 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) error: 'LIBBURN_MISCONFIGURATION_' undeclared (first use in this function) */ /* The indendation is an advise of man gcc to help old compilers ignoring */ #if isoburn_libburn_req_major > burn_header_version_major #define Isoburn_libburn_dot_h_too_olD 1 #endif #if isoburn_libburn_req_major == burn_header_version_major && isoburn_libburn_req_minor > burn_header_version_minor #define Isoburn_libburn_dot_h_too_olD 1 #endif #if isoburn_libburn_req_minor == burn_header_version_minor && isoburn_libburn_req_micro > burn_header_version_micro #define Isoburn_libburn_dot_h_too_olD 1 #endif #ifdef Isoburn_libburn_dot_h_too_olD LIBBURN_MISCONFIGURATION = 0; INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_libburn_dot_h_TOO_OLD__SEE_libisoburn_dot_h_and_burn_wrap_dot_h = 0; LIBBURN_MISCONFIGURATION_ = 0; #endif /* End of ugly compile time tests (scroll up for explanation) */ msg[0]= 0; if(iso_init()<0) { sprintf(msg+strlen(msg), "Cannot initialize libisofs\n"); return(0); } iso_lib_version(&major, &minor, µ); sprintf(msg+strlen(msg), "libisofs-%d.%d.%d ", major, minor, micro); #ifdef iso_lib_header_version_major if(iso_lib_is_compatible(iso_lib_header_version_major, iso_lib_header_version_minor, iso_lib_header_version_micro)) { sprintf(msg+strlen(msg), "ok, "); } else { sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n", iso_lib_header_version_major, iso_lib_header_version_minor, iso_lib_header_version_micro); bad_match= 1; } #else if(iso_lib_is_compatible(isoburn_libisofs_req_major, isoburn_libisofs_req_minor, isoburn_libisofs_req_micro)) { sprintf(msg+strlen(msg), "suspicious, "); } else { sprintf(msg+strlen(msg),"- TOO OLD -, need at least libisofs-%d.%d.%d ,\n", isoburn_libisofs_req_major, isoburn_libisofs_req_minor, isoburn_libisofs_req_micro); bad_match= 1; } #endif /* ! iso_lib_header_version_major */ if(!burn_initialize()) { sprintf(msg+strlen(msg), "Cannot initialize libburn\n"); return(0); } burn_version(&major, &minor, µ); sprintf(msg+strlen(msg), "libburn-%d.%d.%d ", major, minor, micro); if(major > burn_header_version_major || (major == burn_header_version_major && (minor > burn_header_version_minor || (minor == burn_header_version_minor && micro >= burn_header_version_micro)))) { sprintf(msg+strlen(msg), "ok, "); } else { sprintf(msg+strlen(msg), "- TOO OLD -, need at least libburn-%d.%d.%d ,\n", burn_header_version_major, burn_header_version_minor, burn_header_version_micro); bad_match= 1; } isoburn_version(&major, &minor, µ); sprintf(msg+strlen(msg), "for libisoburn-%d.%d.%d", major, minor, micro); if(bad_match) return(0); isoburn_destroy_all(&isoburn_list_start, 0); /* isoburn_list_start= NULL */ return(1); }
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 libisofs.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...
major | obtained at build time | |
minor | obtained at build time | |
micro | obtained at build time | |
flag | Bitfield for control purposes. Unused yet. Submit 0. |
Definition at line 641 of file isoburn.c.
References isoburn_version().
{ int own_major, own_minor, own_micro; isoburn_version(&own_major, &own_minor, &own_micro); return(own_major > major || (own_major == major && (own_minor > minor || (own_minor == minor && own_micro >= micro)))); }
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.
major | isoburn_libburn_req_major as seen at build time | |
minor | as seen at build time | |
micro | as seen at build time |
Definition at line 223 of file burn_wrap.c.
{
*major= burn_header_version_major;
*minor= burn_header_version_minor;
*micro= burn_header_version_micro;
return(1);
}
int isoburn_libisofs_req | ( | int * | major, | |
int * | minor, | |||
int * | micro | |||
) |
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.
major | isoburn_libisofs_req_major as seen at build time | |
minor | as seen at build time | |
micro | as seen at build time |
Definition at line 213 of file burn_wrap.c.
{
*major= iso_lib_header_version_major;
*minor= iso_lib_header_version_minor;
*micro= iso_lib_header_version_micro;
return(1);
}
int isoburn_needs_emulation | ( | struct burn_drive * | d | ) |
Inquire wether the media needs emulation or would be suitable for generic multi-session via libburn.
d | The drive to inquire |
Definition at line 831 of file burn_wrap.c.
References isoburn::emulation_mode, isoburn_disc_get_status(), and isoburn_find_emulator().
{ int ret; struct isoburn *o; enum burn_disc_status s; s= isoburn_disc_get_status(drive); if(s!=BURN_DISC_BLANK && s!=BURN_DISC_APPENDABLE) return(-1); ret= isoburn_find_emulator(&o, drive, 0); if(ret<0) return(-1); if(ret>0) if(o->emulation_mode>0) return(1); return(0); }
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 | |||
) |
To choose the expansion 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 aquired $msc1 was set by isoburn_set_msc1() before image reading or was detected from the in_drive media $nwa is a parameter of this call or can be used as detected from the in_drive media
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().
in_drive | The input drive,grabbed with isoburn_drive_scan_and_grab(). | |
disc | Returns the newly created burn_disc object. | |
opts | Options for image generation and data transport to media. | |
out_drive | The output drive, from isoburn_drive_aquire() et.al.. typically stdio:/dev/fd/1 . | |
nwa | The address (2048 byte block count) where the add-on session will be finally stored on a mountable media or in a mountable file. If nwa is -1 then the address is used as determined from the in_drive media. |
Definition at line 557 of file isoburn.c.
References isoburn::fabricated_msc2, isoburn_find_emulator(), isoburn_prepare_disc_aux(), isoburn::nwa, and isoburn::zero_nwa.
{ int ret; struct isoburn *o= NULL; ret= isoburn_find_emulator(&o, out_drive, 0); if(ret<0 || o==NULL) return(-1); if(nwa >= 0) o->fabricated_msc2= nwa; if(o->nwa == o->zero_nwa) o->nwa= o->zero_nwa= 0; else o->zero_nwa= 0; ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 2); if (ret<=0) return ret; return(1); }
int isoburn_prepare_disc | ( | struct burn_drive * | drive, | |
struct burn_disc ** | disc, | |||
struct isoburn_imgen_opts * | opts | |||
) |
To choose the expansion 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 media from where the image was eventually loaded.
This 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().
drive | The combined source and target drive, grabbed with isoburn_drive_scan_and_grab(). . | |
disc | Returns the newly created burn_disc object. | |
opts | Image generation options, see isoburn_igopt_*() |
Definition at line 536 of file isoburn.c.
References isoburn_prepare_disc_aux().
{ return isoburn_prepare_disc_aux(d, d, disc, opts, 0); }
int isoburn_prepare_new_image | ( | struct burn_drive * | in_drive, | |
struct burn_disc ** | disc, | |||
struct isoburn_imgen_opts * | opts, | |||
struct burn_drive * | out_drive | |||
) |
To choose the expansion 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 media. 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. 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().
in_drive | The input drive, grabbed with isoburn_drive_aquire() or one of its alternatives. | |
disc | Returns the newly created burn_disc object. | |
opts | Options for image generation and data transport to media. | |
out_drive | The output drive, from isoburn_drive_aquire() et.al.. |
Definition at line 543 of file isoburn.c.
References isoburn_prepare_disc_aux().
{ int ret; ret= isoburn_prepare_disc_aux(d, out_drive, disc, opts, 1); if (ret<=0) return ret; return 1; }
int isoburn_read_image | ( | struct burn_drive * | d, | |
struct isoburn_read_opts * | read_opts, | |||
IsoImage ** | image | |||
) |
Load the ISO filesystem directory tree from the media 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.
d | The 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_opts | The read options which can be chosen by the application | |
image | the 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. |
Definition at line 112 of file isofs_wrap.c.
References isoburn_read_opts::auto_input_charset, isoburn_read_opts::dirmode, isoburn_read_opts::gid, isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, isoburn::image, 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_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_pacifier, isoburn::read_pacifier_handle, isoburn_read_opts::size, and isoburn_read_opts::uid.
{ int ret, int_num, dummy; IsoReadOpts *ropts= NULL; IsoReadImageFeatures *features= NULL; uint32_t ms_block; char msg[160]; enum burn_disc_status status= BURN_DISC_BLANK; IsoDataSource *ds= NULL; struct isoburn *o= NULL; if(d != NULL) { ret = isoburn_find_emulator(&o, d, 0); if (ret < 0 || o == NULL) return 0; status = isoburn_disc_get_status(d); } if(read_opts==NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: read_opts==NULL", 0, "FATAL", 0); return(-1); } if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) { create_blank_image:; /* * Blank disc, we create a new image without files. */ if (d == NULL) { /* New empty image without relation to a drive */ if (image==NULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: image==NULL", 0, "FATAL", 0); return -1; } /* create a new image */ ret = iso_image_new("ISOIMAGE", image); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0); return ret; } } else { /* Blank new image for the drive */ iso_image_unref(o->image); ret = iso_image_new("ISOIMAGE", &o->image); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0); return ret; } if (image) { *image = o->image; iso_image_ref(*image); /*protects object from premature free*/ } } iso_image_set_ignore_aclea(*image, (!!(read_opts->noacl)) | ((!!read_opts->noea) << 1) ); return 1; } if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) { isoburn_msgs_submit(o, 0x00060000, "Program error: isoburn_read_image: incorrect disc status", 0, "FATAL", 0); return -4; } memset((char *) &ropts, 0, sizeof(ropts)); ret = isoburn_disc_get_msc1(d, &int_num); if (ret <= 0) return -2; ms_block= int_num; ret = isoburn_read_iso_head(d, int_num, &dummy, NULL, 0); if (ret <= 0) { sprintf(msg, "No ISO 9660 image at LBA %d. Creating blank image.", int_num); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); goto create_blank_image; } /* create the data source */ ret = iso_read_opts_new(&ropts, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0); return ret; } /* Important: do not return until iso_read_opts_free() */ iso_read_opts_set_start_block(ropts, ms_block); iso_read_opts_set_no_rockridge(ropts, read_opts->norock); iso_read_opts_set_no_aaip(ropts, read_opts->noaaip); iso_read_opts_set_no_md5(ropts, read_opts->nomd5); iso_read_opts_set_new_inos(ropts, read_opts->noino); iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet); iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999); iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet); iso_read_opts_set_default_permissions(ropts, read_opts->mode, read_opts->dirmode); iso_read_opts_set_default_uid(ropts, read_opts->uid); iso_read_opts_set_default_gid(ropts, read_opts->gid); iso_read_opts_set_input_charset(ropts, read_opts->input_charset); iso_read_opts_auto_input_charset(ropts, read_opts->auto_input_charset); iso_read_opts_load_system_area(ropts, 1); ds = isoburn_data_source_new(d); if(o->iso_data_source!=NULL) iso_data_source_unref(o->iso_data_source); o->iso_data_source= ds; iso_image_attach_data(o->image, o->read_pacifier_handle, isoburn_idle_free_function); if(o->read_pacifier_handle==NULL) iso_tree_set_report_callback(o->image, NULL); else iso_tree_set_report_callback(o->image, o->read_pacifier); ret = iso_image_import(o->image, ds, ropts, &features); iso_tree_set_report_callback(o->image, NULL); iso_read_opts_free(ropts); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0); return ret; } /* Important: do not return until free(features) */ if (image!=NULL) { *image = o->image; iso_image_ref(*image); /*protects object from premature free*/ } read_opts->hasRR = iso_read_image_features_has_rockridge(features); read_opts->hasJoliet = iso_read_image_features_has_joliet(features); read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features); read_opts->hasElTorito = iso_read_image_features_has_eltorito(features); read_opts->size = iso_read_image_features_get_size(features); iso_read_image_features_destroy(features); return 1; }
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.
d | The drive with the media to inspect | |
lba | The block number from where to read | |
image_blocks | The number of 2048 bytes blocks | |
info | Caller provided memory, enough to take eventual info reply | |
flag | bit0-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= |
Definition at line 1068 of file burn_wrap.c.
References isoburn_read_iso_head_parse().
Referenced by isoburn_emulate_toc(), isoburn_get_mount_params(), isoburn_read_image(), and isoburn_set_msc1().
{ unsigned char buffer[64*1024]; int ret, info_mode, capacity, role; off_t data_count, to_read; info_mode= flag&255; *image_blocks= 0; if(flag&(1<<13)) { memcpy(buffer, info, 64*1024); } else { role = burn_drive_get_drive_role(d); ret = burn_get_read_capacity(d, &capacity, 0); if (ret <= 0 && role == 2) { /* Might be a block device on a system where libburn cannot determine its size. Try to read anyway. */ capacity = 0x7ffffff0; ret = 1; } memset(buffer, 0, 64 * 1024); to_read= (off_t) capacity * ((off_t) 2048); if(ret > 0 && to_read >= (off_t) (36 * 1024)) { if(to_read >= (off_t) (64 * 1024)) to_read= 64 * 1024; ret = burn_read_data(d, ((off_t) lba) * (off_t) 2048, (char *) buffer, to_read, &data_count, 2); /* no error messages */ } else ret= 0; if(ret<=0) return(-1*!!(flag&(1<<15))); if(info_mode==2) memcpy(info, buffer, 64*1024); } if(flag&(1<<14)) { ret= isoburn_read_iso_head_parse(d, buffer, image_blocks, info, info_mode); if(ret<0) return(ret); if(ret>0) return(2); } ret= isoburn_read_iso_head_parse(d, buffer+32*1024, image_blocks, info, info_mode); if(ret<=0) return(ret); return(1); }
int isoburn_ropt_destroy | ( | struct isoburn_read_opts ** | o, | |
int | flag | |||
) |
Deletes an option set which was created by isoburn_ropt_new().
o | The option set to work on | |
flag | Bitfield for control purposes. Submit 0 for now. |
Definition at line 693 of file isoburn.c.
{ if(*o==NULL) return(0); free(*o); *o= NULL; return(1); }
int isoburn_ropt_get_auto_incharset | ( | struct isoburn_read_opts * | o, | |
int * | mode | |||
) |
Definition at line 798 of file isoburn.c.
References isoburn_read_opts::auto_input_charset.
{ *mode= o->auto_input_charset; return(1); }
int isoburn_ropt_get_default_dirperms | ( | struct isoburn_read_opts * | o, | |
mode_t * | mode | |||
) |
Definition at line 767 of file isoburn.c.
References isoburn_read_opts::dirmode.
{ *mode= o->dirmode; return(1); }
int isoburn_ropt_get_default_perms | ( | struct isoburn_read_opts * | o, | |
uid_t * | uid, | |||
gid_t * | gid, | |||
mode_t * | mode | |||
) |
Definition at line 749 of file isoburn.c.
References isoburn_read_opts::gid, isoburn_read_opts::mode, and isoburn_read_opts::uid.
int isoburn_ropt_get_extensions | ( | struct isoburn_read_opts * | o, | |
int * | ext | |||
) |
Definition at line 719 of file isoburn.c.
References 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.
{ *ext= (!!o->norock) | ((!!o->nojoliet)<<1) | ((!!o->noiso1999)<<2) | ((!!o->preferjoliet)<<3) | ((!!o->pretend_blank)<<4) | ((!!o->noaaip) << 5) | ((!!o->noacl) << 6) | ((!!o->noea) << 7) | ((!!o->noino) << 8) | ((!!o->nomd5) << 9); return(1); }
int isoburn_ropt_get_input_charset | ( | struct isoburn_read_opts * | o, | |
char ** | input_charset | |||
) |
Definition at line 783 of file isoburn.c.
References isoburn_read_opts::input_charset.
{ *input_charset= o->input_charset; return(1); }
int isoburn_ropt_get_size_what | ( | struct isoburn_read_opts * | o, | |
uint32_t * | size, | |||
int * | has_what | |||
) |
Definition at line 805 of file isoburn.c.
References isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, and isoburn_read_opts::size.
{ *size= o->size; *has_what= (!!o->hasRR) | ((!!o->hasJoliet)<<1) | ((!!o->hasIso1999)<<2) | ((!!o->hasElTorito)<<3); return(1); }
int isoburn_ropt_new | ( | struct isoburn_read_opts ** | o, | |
int | flag | |||
) |
Produces a set of image read options, initialized with default values.
o | the newly created option set object | |
flag | Bitfield for control purposes. Submit 0 for now. |
Definition at line 659 of file isoburn.c.
References isoburn_read_opts::dirmode, 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::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, and isoburn_read_opts::uid.
{ struct isoburn_read_opts *o; o= (*new_o)= calloc(1, sizeof(struct isoburn_read_opts)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for read options", 0, "FATAL", 0); return(-1); } o->norock= 0; o->nojoliet= 0; o->noiso1999= 1; o->noaaip= 1; o->noacl= 1; o->noea= 1; o->noino= 1; o->nomd5= 1; o->preferjoliet= 0; o->uid= geteuid(); o->gid= getegid(); o->mode= 0444; o->dirmode= 0555; o->input_charset= NULL; o->hasRR= 0; o->hasJoliet= 0; o->hasIso1999= 0; o->hasElTorito= 0; o->size= 0; o->pretend_blank= 1; return(1); }
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()
o | The option set to work on | |
mode | Bitfield for control purposes: bit0= allow to set the input character set automatically from attribute "isofs.cs" of root directory. Submit any other bits with value 0. |
Definition at line 791 of file isoburn.c.
References isoburn_read_opts::auto_input_charset.
{ o->auto_input_charset= mode & 1; return(1); }
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 independend permissions for directories, especially to override the automatically added x-permissions.
o | The option set to work on | |
mode | permissions (not file type) as of man 2 stat. |
Definition at line 759 of file isoburn.c.
References isoburn_read_opts::dirmode.
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.
o | The option set to work on | |
uid | user id number (see /etc/passwd) | |
gid | group id number (see /etc/group) | |
mode | permissions (not file type) as of man 2 stat. With directories, r-permissions will automatically imply x-permissions. See isoburn_ropt_set_default_dirperms() below. |
Definition at line 729 of file isoburn.c.
References isoburn_read_opts::dirmode, isoburn_read_opts::gid, isoburn_read_opts::mode, and isoburn_read_opts::uid.
int isoburn_ropt_set_extensions | ( | struct isoburn_read_opts * | o, | |
int | ext | |||
) |
Definition at line 703 of file isoburn.c.
References 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.
{ o->norock= !!(ext&1); o->nojoliet= !!(ext&2); o->noiso1999= !!(ext&4); o->preferjoliet= !!(ext&8); o->pretend_blank= !!(ext&16); o->noaaip= !!(ext & 32); o->noacl= !!(ext & 64); o->noea= !!(ext & 128); o->noino= !!(ext & 256); o->nomd5= !!(ext & 512); return(1); }
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.
o | The option set to work on | |
input_charset | Set 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". |
Definition at line 775 of file isoburn.c.
References isoburn_read_opts::input_charset.
{ o->input_charset= input_charset; return(1); }
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 aquiring 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.
d | The drive where msc1 is to be set | |
adr_mode | Determines 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 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_value | A string describing the value to be eventually used. | |
flag | Bitfield for control purposes. bit0= |
Definition at line 1640 of file burn_wrap.c.
References isoburn_toc_disc::disc, isoburn::fabricated_msc1, 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().
{ int ret, num_sessions= 0, num_tracks, adr_num, i, j, total_tracks; int lba, best_lba, size, re_valid= 0, track_count= 0; time_t start_time= 0, last_pacifier= 0, now; char volid[33], msg[160]; struct isoburn *o; struct isoburn_toc_disc *disc= NULL; struct isoburn_toc_session **sessions= NULL; struct isoburn_toc_track **tracks= NULL; static char mode_names[][20]= {"auto", "session", "track", "lba", "volid"}; static int max_mode_names= 4; regex_t re; regmatch_t match[1]; ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(-1); if(o==NULL) return(-1); start_time= last_pacifier= time(NULL); adr_num= atoi(adr_value); if(adr_mode!=3 || (flag & 2)) { disc= isoburn_toc_drive_get_disc(d); if(disc==NULL) { not_found:; if(adr_mode<0 || adr_mode>max_mode_names) goto unknown_mode; sprintf(msg, "Failed to find %s %s", mode_names[adr_mode], strlen(adr_value)<=80 ? adr_value : "-oversized-string-"); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); ret= 0; goto ex; } sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions); if(sessions==NULL || num_sessions<=0) goto not_found; } if(adr_mode==0) { /* Set fabricated_msc1 to last session in TOC */ tracks= isoburn_toc_session_get_tracks(sessions[num_sessions-1], &num_tracks); if(tracks==NULL || num_tracks<=0) goto not_found; isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0); } else if(adr_mode==1) { /* Use adr_num as session index (first session is 1, not 0) */ if(adr_num<1 || adr_num>num_sessions) goto not_found; tracks= isoburn_toc_session_get_tracks(sessions[adr_num-1], &num_tracks); if(tracks==NULL || num_tracks<=0) goto not_found; isoburn_get_track_lba(tracks[0], &(o->fabricated_msc1), 0); } else if(adr_mode==2) { /* use adr_num as track index */ total_tracks= 0; for(i=0; i<num_sessions; i++) { tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks); if(tracks==NULL) continue; for(j= 0; j<num_tracks; j++) { total_tracks++; if(total_tracks==adr_num) { isoburn_get_track_lba(tracks[j], &(o->fabricated_msc1), 0); ret= 1; goto ex; } } } goto not_found; } else if(adr_mode==3) { o->fabricated_msc1= adr_num; if((flag & 1) && o->fabricated_msc1 >= 16) { /* adr_num is possibly 16 blocks too high */ ret= isoburn_read_iso_head(d, o->fabricated_msc1, &size,volid, 1|(1<<14)); if(ret==2) o->fabricated_msc1-= 16; } } else if(adr_mode==4) { /* search for volume id that is equal to adr_value */ if(flag & 4) { ret= regcomp(&re, adr_value, 0); if(ret != 0) flag&= ~4; else re_valid= 1; } best_lba= -1; for(i=0; i<num_sessions; i++) { tracks= isoburn_toc_session_get_tracks(sessions[i], &num_tracks); if(tracks==NULL) continue; for(j= 0; j<num_tracks; j++) { now= time(NULL); if(now - last_pacifier >= 5 && track_count > 0) { last_pacifier= now; sprintf(msg, "Scanned %d tracks for matching volid in %.f seconds", track_count, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0); } track_count++; ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0); if(ret < 0) continue; if(ret == 0) { isoburn_get_track_lba(tracks[0], &lba, 0); ret= isoburn_read_iso_head(d, lba, &size, volid, 1); if(ret<=0) continue; } if(flag & 4) { ret= regexec(&re, volid, 1, match, 0); if(ret != 0) continue; } else { if(strcmp(volid, adr_value)!=0) continue; } best_lba= lba; } } if(best_lba<0) goto not_found; o->fabricated_msc1= best_lba; } else { unknown_mode:; sprintf(msg, "Program error: Unknown msc1 address mode %d", adr_mode); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FATAL", 0); ret= 0; goto ex; } ret= 1; ex:; if(start_time != last_pacifier && track_count > 0) { now= time(NULL); sprintf(msg, "Scanned %d tracks for matching volid in %.f seconds", track_count, (double) (now - start_time)); isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0); } if(disc!=NULL) isoburn_toc_disc_free(disc); if((flag & 4) && re_valid) regfree(&re); return(ret); }
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 libaries 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.
msgs_submit | The function call which implements the method | |
submit_handle | Handle to be used as first argument of msgs_submit | |
submit_flag | Flag to be used as last argument of msgs_submit | |
flag | Unused yet, submit 0 |
Definition at line 232 of file burn_wrap.c.
References libisoburn_default_msgs_submit, libisoburn_default_msgs_submit_flag, libisoburn_default_msgs_submit_handle, and isoburn::msgs_submit.
{ libisoburn_default_msgs_submit= msgs_submit; libisoburn_default_msgs_submit_handle= submit_handle; libisoburn_default_msgs_submit_flag= submit_flag; return(1); }
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.
drive | The drive which will be used with isoburn_read_image() It has to be aquired by an isoburn_* wrapper call. | |
read_pacifier | The callback function | |
app_handle | The app handle which the callback function can obtain via iso_image_get_attached_data() from its IsoImage* |
Definition at line 418 of file isofs_wrap.c.
References isoburn_find_emulator(), isoburn::read_pacifier, and isoburn::read_pacifier_handle.
{ int ret; struct isoburn *o; ret = isoburn_find_emulator(&o, drive, 0); if(ret < 0 || o == NULL) return -1; o->read_pacifier_handle= read_handle; o->read_pacifier= read_pacifier; return(1); }
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.
input_drive | The drive resp. in_drive which was used with the preparation call. | |
output_drive | The out_drive used with isoburn_prepare_new_image(), NULL if none. | |
flag | Bitfield, submit 0 for now. |
Definition at line 618 of file isoburn.c.
References isoburn_cancel_prepared_write().
{ return isoburn_cancel_prepared_write(d, output_drive, 1); }
void isoburn_toc_disc_free | ( | struct isoburn_toc_disc * | disc | ) |
Release the memory associated with a master handle of media.
The handle is invalid afterwards and may not be used any more. Wrapper for: burn_disc_free()
disc | The master handle of the media |
Definition at line 1595 of file burn_wrap.c.
References isoburn_toc_disc::disc, and isoburn_toc_destroy_arrays().
Referenced by isoburn_set_msc1(), and isoburn_welcome_media().
{ if(d->disc!=NULL) burn_disc_free(d->disc); isoburn_toc_destroy_arrays(d, 0); free((char *) d); }
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().
disc | The master handle of the media |
Definition at line 1450 of file burn_wrap.c.
References isoburn_toc_disc::disc, isoburn_toc_entry::next, isoburn_toc_entry::start_lba, isoburn_toc_disc::toc, and isoburn_toc_entry::track_blocks.
{ struct isoburn_toc_entry *t; int ret= 0, num_sessions, num_tracks; struct burn_session **sessions; struct burn_track **tracks; struct burn_toc_entry entry; if(disc==NULL) return(0); if(disc->toc!=NULL) { for(t= disc->toc; t!=NULL; t= t->next) ret= t->start_lba + t->track_blocks; } else if(disc->disc!=NULL) { sessions= burn_disc_get_sessions(disc->disc, &num_sessions); if(num_sessions > 0) { tracks = burn_session_get_tracks(sessions[num_sessions - 1], &num_tracks); if(num_tracks > 0) { burn_track_get_entry(tracks[num_tracks - 1], &entry); if(entry.extensions_valid & 1) ret= entry.start_lba + entry.track_blocks; } } /* ret= burn_disc_get_sectors(disc->disc); */ } return(ret); }
struct isoburn_toc_session** isoburn_toc_disc_get_sessions | ( | struct isoburn_toc_disc * | disc, | |
int * | num | |||
) | [read] |
Get the array of session handles from the table of content.
Wrapper for: burn_disc_get_sessions()
disc | The master handle of the media | |
num | returns the number of sessions in the array |
Definition at line 1482 of file burn_wrap.c.
References isoburn_toc_disc::session_count, and isoburn_toc_disc::session_pointers.
Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), and isoburn_welcome_media().
{ *num= disc->session_count; return(disc->session_pointers); }
struct isoburn_toc_disc* isoburn_toc_drive_get_disc | ( | struct burn_drive * | d | ) | [read] |
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()
d | The drive with the media to inspect |
Definition at line 1364 of file burn_wrap.c.
References isoburn_toc_disc::disc, 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(), and isoburn_welcome_media().
{ int ret, session_count= 0, track_count= 0, num_tracks= 0, i, j; struct isoburn *o; struct isoburn_toc_entry *t; struct isoburn_toc_disc *toc_disc= NULL; struct burn_session **s; struct burn_track **tracks; toc_disc= calloc(1, sizeof(struct isoburn_toc_disc)); if(toc_disc==NULL) return(NULL); toc_disc->disc= NULL; toc_disc->sessions= NULL; toc_disc->session_pointers= NULL; toc_disc->tracks= NULL; toc_disc->track_pointers= NULL; toc_disc->session_count= 0; toc_disc->track_count= 0; toc_disc->toc= NULL; /* is the media emulated multi-session ? */ ret= isoburn_find_emulator(&o, d, 0); if(ret<0) goto libburn; if(o->toc==NULL) goto libburn; /* This is an emulated TOC */ toc_disc->toc= o->toc; for(t= toc_disc->toc; t!=NULL; t= t->next) session_count++; ret= isoburn_toc_new_arrays(toc_disc, session_count, session_count, 0); if(ret<=0) goto failure; t= toc_disc->toc; for(i= 0; i<session_count; i++) { toc_disc->sessions[i].track_pointers= toc_disc->track_pointers+i; toc_disc->sessions[i].track_count= 1; toc_disc->sessions[i].toc_entry= t; toc_disc->session_pointers[i]= toc_disc->sessions+i; toc_disc->tracks[i].toc_entry= t; toc_disc->track_pointers[i]= toc_disc->tracks+i; t= t->next; } toc_disc->session_count= session_count; toc_disc->track_count= session_count; return(toc_disc); libburn:; /* This is a libburn provided TOC */ toc_disc->disc= burn_drive_get_disc(d); if(toc_disc->disc == NULL) { failure:; free((char *) toc_disc); return(NULL); } s= burn_disc_get_sessions(toc_disc->disc, &session_count); for(i= 0; i<session_count; i++) { tracks = burn_session_get_tracks(s[i], &num_tracks); track_count+= num_tracks; } if(session_count<=0 || track_count<=0) goto failure; ret= isoburn_toc_new_arrays(toc_disc, session_count, track_count, 0); if(ret<=0) goto failure; track_count= 0; for(i= 0; i<session_count; i++) { tracks = burn_session_get_tracks(s[i], &num_tracks); toc_disc->sessions[i].session= s[i]; toc_disc->sessions[i].track_pointers= toc_disc->track_pointers+track_count; toc_disc->sessions[i].track_count= num_tracks; toc_disc->session_pointers[i]= toc_disc->sessions+i; for(j= 0; j<num_tracks; j++) { toc_disc->tracks[track_count+j].track= tracks[j]; toc_disc->track_pointers[track_count+j]= toc_disc->tracks+(track_count+j); } track_count+= num_tracks; } toc_disc->session_count= session_count; toc_disc->track_count= track_count; return(toc_disc); }
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()
s | The session handle | |
entry | A 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 1533 of file burn_wrap.c.
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.
{ struct isoburn_toc_track *t; if(s==NULL) return; if(s->session!=NULL && s->toc_entry==NULL) { burn_session_get_leadout_entry(s->session, entry); return; } if(s->track_count<=0 || s->track_pointers==NULL || s->toc_entry==NULL) return; t= s->track_pointers[s->track_count-1]; entry->start_lba= t->toc_entry->start_lba + t->toc_entry->track_blocks; entry->track_blocks= 0; isoburn_toc_entry_finish(entry, s->toc_entry->session, t->toc_entry->track_no, 0); }
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()
s | The session handle |
Definition at line 1490 of file burn_wrap.c.
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.
{ struct isoburn_toc_entry *t; int count= 0, i; if(s==NULL) return(0); if(s->toc_entry!=NULL) { t= s->toc_entry; for(i= 0; i<s->track_count; i++) { count+= t->track_blocks; t= t->next; } } else if(s->session!=NULL) count= burn_session_get_sectors(s->session); return(count); }
struct isoburn_toc_track** isoburn_toc_session_get_tracks | ( | struct isoburn_toc_session * | s, | |
int * | num | |||
) | [read] |
Get the array of track handles from a particular session.
Wrapper for: burn_session_get_tracks()
s | The session handle | |
num | returns the number of tracks in the array |
Definition at line 1554 of file burn_wrap.c.
References isoburn_toc_session::track_count, and isoburn_toc_session::track_pointers.
Referenced by isoburn_get_mount_params(), isoburn_set_msc1(), and isoburn_welcome_media().
{ *num= s->track_count; return(s->track_pointers); }
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.
t | The track handle | |
start_lba | Returns the start address of the ISO session | |
image_blocks | Returns the number of 2048 bytes blocks | |
volid | Caller provided memory for the volume id | |
flag | unused yet, submit 0 |
Definition at line 1580 of file burn_wrap.c.
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().
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.
Wrapper for: burn_track_get_entry()
t | The track handle | |
entry | A 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 1562 of file burn_wrap.c.
References isoburn_toc_entry_finish(), isoburn_toc_entry::session, isoburn_toc_entry::start_lba, isoburn_toc_track::toc_entry, isoburn_toc_track::track, isoburn_toc_entry::track_blocks, and isoburn_toc_entry::track_no.
Referenced by isoburn_get_track_lba().
{ if(t==0) return; if(t->track!=NULL && t->toc_entry==NULL) { burn_track_get_entry(t->track, entry); return; } if(t->toc_entry==NULL) return; entry->start_lba= t->toc_entry->start_lba; entry->track_blocks= t->toc_entry->track_blocks; isoburn_toc_entry_finish(entry, t->toc_entry->session, t->toc_entry->track_no, 0); }
void isoburn_version | ( | int * | major, | |
int * | minor, | |||
int * | micro | |||
) |
Obtain the three release version numbers of the library.
These are the numbers encountered by the application when linking with libisoburn, i.e. possibly not before run time. Better do not base the fundamental compatibility decision of an application on these numbers. For a reliable check use isoburn_is_compatible().
major | The maturity version (0 for now, as we are still learning) | |
minor | The development goal version. | |
micro | The development step version. This has an additional meaning: |
Pare numbers indicate a version with frozen API. I.e. you can rely on the same set of features to be present in all published releases with that major.minor.micro combination. Features of a pare release will stay available and ABI compatible as long as the SONAME of libisoburn stays "1". Currently there are no plans to ever change the SONAME.
Odd numbers indicate that API upgrades are in progress. I.e. new features might be already present or they might be still missing. Newly introduced features may be changed incompatibly or even be revoked before release of a pare version. So micro revisions {1,3,5,7,9} should never be used for dynamic linking unless the proper library match can be guaranteed by external circumstances.
Definition at line 625 of file isoburn.c.
Referenced by isoburn_initialize(), and isoburn_is_compatible().
{ *major= isoburn_header_version_major; *minor= isoburn_header_version_minor; *micro= isoburn_header_version_micro; /* No more: values from version.h generated from version.h.in and macro values defined in configure.ac *major = ISOBURN_MAJOR_VERSION; *minor = ISOBURN_MINOR_VERSION; *micro = ISOBURN_MICRO_VERSION; */ }