xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

drive_mgt.c File Reference
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <errno.h>
#include <pthread.h>
#include "xorriso.h"
#include "xorriso_private.h"
#include "lib_mgt.h"
#include "drive_mgt.h"
#include "iso_img.h"
#include "sort_cmp.h"
#include "write_run.h"
#include "read_run.h"
Include dependency graph for drive_mgt.c:

Go to the source code of this file.

Data Structures

struct  xorriso_md5_state
 

Functions

static const char * un0 (const char *text)
 
int Xorriso_auto_driveadr (struct XorrisO *xorriso, char *adr, char *result, int flag)
 
static int Xorriso_grasp_loaded_aaip (struct XorrisO *xorriso, IsoImage *volset, int flag)
 
int Xorriso_set_speed (struct XorrisO *xorriso, struct burn_drive *drive, int read_speed, int write_speed, int flag)
 
int Xorriso_aquire_drive (struct XorrisO *xorriso, char *adr, char *show_adr, int flag)
 
int Xorriso_give_up_drive (struct XorrisO *xorriso, int flag)
 
int Xorriso_may_burn (struct XorrisO *xorriso, int flag)
 
int Xorriso_toc_to_string (struct XorrisO *xorriso, char **toc_text, int flag)
 
int Xorriso_reaquire_outdev (struct XorrisO *xorriso, int flag)
 
int Xorriso_toc_line (struct XorrisO *xorriso, int flag)
 
int Xorriso_media_product (struct XorrisO *xorriso, int flag)
 
int Xorriso_toc (struct XorrisO *xorriso, int flag)
 
int Xorriso_show_devices (struct XorrisO *xorriso, int flag)
 
int Xorriso_tell_media_space (struct XorrisO *xorriso, int *media_space, int *free_space, int flag)
 
int Xorriso_list_formats (struct XorrisO *xorriso, int flag)
 
int Xorriso_choose_speed_factor (struct XorrisO *xorriso, int speed, int profile, struct burn_drive *drive, double *speed_factor, char **speed_unit, int flag)
 
int Xorriso__reverse_int_cmp (const void *a, const void *b)
 
int Xorriso_list_speeds_sub (struct XorrisO *xorriso, int flag)
 
int Xorriso_list_speeds (struct XorrisO *xorriso, int flag)
 
int Xorriso_list_profiles (struct XorrisO *xorriso, int flag)
 
int Xorriso_atip (struct XorrisO *xorriso, int flag)
 
int Xorriso_get_profile (struct XorrisO *xorriso, int *profile_number, char profile_name[80], int flag)
 
int Xorriso_msinfo (struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
 
int Xorriso_drive_snooze (struct XorrisO *xorriso, int flag)
 
int Xorriso_scsi_log (struct XorrisO *xorriso, int flag)
 
int Xorriso_check_md5_range (struct XorrisO *xorriso, off_t start_lba, off_t end_lba, char md5[16], int flag)
 
int Xorriso_check_session_md5 (struct XorrisO *xorriso, char *severity, int flag)
 
int Xorriso_check_for_abort (struct XorrisO *xorriso, char *abort_file_path, double post_read_time, double *last_abort_file_time, int flag)
 
int Xorriso__add_spot (struct xorriso_md5_state *state, int start_lba, int blocks, int quality, int flag)
 
int Xorriso_chunk_md5 (struct XorrisO *xorriso, char *data, int to_read, uint32_t from_lba, struct xorriso_md5_state *state, int flag)
 
static void * Xorriso__md5_slave (void *state_pt)
 
int Xorriso_start_chunk_md5 (struct XorrisO *xorriso, struct xorriso_md5_state *state, int flag)
 
int Xorriso__wait_chunk_md5 (struct xorriso_md5_state *state, int u_wait, int flag)
 
int Xorriso__wait_slave_md5_end (struct xorriso_md5_state *state, int u_wait, int flag)
 
int Xorriso__end_slave_md5 (struct xorriso_md5_state *state, int u_wait, int flag)
 
int Xorriso_check_interval (struct XorrisO *xorriso, struct SpotlisT *spotlist, struct CheckmediajoB *job, int from_lba, int block_count, int read_chunk, int md5_start, int flag)
 
int Xorriso_check_media (struct XorrisO *xorriso, struct SpotlisT **spotlist, struct CheckmediajoB *job, int flag)
 
int Xorriso_get_drive_handles (struct XorrisO *xorriso, struct burn_drive_info **dinfo, struct burn_drive **drive, char *attempt, int flag)
 
int Xorriso_pretend_full_disc (struct XorrisO *xorriso, int flag)
 
int Xorriso_scsi_dev_family (struct XorrisO *xorriso, int flag)
 
int Xorriso_use_immed_bit (struct XorrisO *xorriso, int flag)
 
int Xorriso_obtain_indev_readsize (struct XorrisO *xorriso, uint32_t *blocks, int flag)
 

Function Documentation

◆ un0()

static const char* un0 ( const char *  text)
static

Definition at line 39 of file drive_mgt.c.

Referenced by Xorriso_aquire_drive().

◆ Xorriso__add_spot()

int Xorriso__add_spot ( struct xorriso_md5_state state,
int  start_lba,
int  blocks,
int  quality,
int  flag 
)

◆ Xorriso__end_slave_md5()

int Xorriso__end_slave_md5 ( struct xorriso_md5_state state,
int  u_wait,
int  flag 
)

◆ Xorriso__md5_slave()

◆ Xorriso__reverse_int_cmp()

int Xorriso__reverse_int_cmp ( const void *  a,
const void *  b 
)

Definition at line 1786 of file drive_mgt.c.

Referenced by Xorriso_list_speeds_sub().

◆ Xorriso__wait_chunk_md5()

int Xorriso__wait_chunk_md5 ( struct xorriso_md5_state state,
int  u_wait,
int  flag 
)

◆ Xorriso__wait_slave_md5_end()

int Xorriso__wait_slave_md5_end ( struct xorriso_md5_state state,
int  u_wait,
int  flag 
)

Definition at line 2768 of file drive_mgt.c.

References xorriso_md5_state::slave_state.

Referenced by Xorriso__end_slave_md5().

◆ Xorriso_aquire_drive()

int Xorriso_aquire_drive ( struct XorrisO xorriso,
char *  adr,
char *  show_adr,
int  flag 
)

Definition at line 257 of file drive_mgt.c.

References XorrisO::abstract_file, XorrisO::application_id, XorrisO::biblio_file, XorrisO::boot_count, XorrisO::boot_image_bin_path, burn_allow_drive_role_4(), BURN_DISC_APPENDABLE, BURN_DISC_BLANK, BURN_DISC_FULL, burn_drive_convert_fs_adr(), burn_drive_equals_adr(), burn_drive_get_immed(), burn_drive_set_immed(), burn_drive_snooze(), burn_preset_device_open(), XorrisO::cache_default, XorrisO::cache_num_tiles, XorrisO::cache_tile_blocks, XorrisO::copyright_file, XorrisO::dev_fd_1, XorrisO::displacement, XorrisO::displacement_sign, XorrisO::do_aaip, XorrisO::do_calm_drive, XorrisO::do_hfsplus, XorrisO::do_md5, burn_drive_info::drive, XorrisO::drives_access, XorrisO::drives_exclusive, XorrisO::early_stdio_test, XorrisO::ecma119_map, XorrisO::file_name_limit, XorrisO::image_start_mode, XorrisO::image_start_value, XorrisO::img_read_error_mode, XorrisO::in_charset, XorrisO::in_drive_handle, XorrisO::in_sector_map, XorrisO::in_volset_handle, XorrisO::indev, XorrisO::indev_access, XorrisO::indev_is_exclusive, XorrisO::indev_off_adr, XorrisO::info_text, XorrisO::ino_behavior, iso_image_get_abstract_file_id(), iso_image_get_application_id(), iso_image_get_biblio_file_id(), iso_image_get_copyright_file_id(), iso_image_get_publisher_id(), iso_image_get_system_id(), iso_image_get_truncate_mode(), iso_image_get_volset_id(), iso_image_ref(), iso_image_set_truncate_mode(), iso_image_unref(), ISO_SB_TREE_CORRUPTED, iso_set_abort_severity(), isoburn_attach_image(), isoburn_attach_start_lba(), isoburn_disc_get_msc1(), isoburn_disc_get_status(), isoburn_drive_aquire(), isoburn_get_attached_image(), isoburn_get_attached_start_lba(), isoburn_get_img_partition_offset(), isoburn_get_mount_params(), isoburn_read_image(), isoburn_ropt_destroy(), isoburn_ropt_get_size_what(), isoburn_ropt_get_tree_loaded(), isoburn_ropt_has_el_torito, isoburn_ropt_joliet_stripped, isoburn_ropt_joliet_unmapped, isoburn_ropt_map_lowercase, isoburn_ropt_map_stripped, isoburn_ropt_map_unmapped, isoburn_ropt_map_uppercase, isoburn_ropt_new(), isoburn_ropt_noaaip, isoburn_ropt_noacl, isoburn_ropt_noea, isoburn_ropt_noino, isoburn_ropt_noiso1999, isoburn_ropt_nojoliet, isoburn_ropt_nomd5, isoburn_ropt_nomd5tag, isoburn_ropt_norock, isoburn_ropt_set_auto_incharset(), isoburn_ropt_set_default_perms(), isoburn_ropt_set_displacement(), isoburn_ropt_set_extensions(), isoburn_ropt_set_input_charset(), isoburn_ropt_set_truncate_mode(), isoburn_set_msc1(), isoburn_set_read_pacifier(), XorrisO::isofs_has_what, XorrisO::isofs_size, XorrisO::isofs_st_out, XorrisO::joliet_map, XorrisO::keep_boot_image, XorrisO::linux_scsi_dev_family, XorrisO::loaded_volid, XorrisO::out_drive_handle, XorrisO::outdev, XorrisO::outdev_access, XorrisO::outdev_is_exclusive, XorrisO::outdev_off_adr, XorrisO::pacifier_count, XorrisO::patch_isolinux_image, XorrisO::publisher, XorrisO::read_fs, XorrisO::read_speed, XorrisO::rr_loaded, Sectorbitmap_destroy(), Sfile_str(), SfileadrL, isoburn_read_opts::size, XorrisO::system_area_clear_loaded, XorrisO::system_area_disk_path, XorrisO::system_id, XorrisO::toc_emulation_flag, XorrisO::tree_loaded, isoburn_read_opts::truncate_mode, un0(), XorrisO::use_immed_bit, XorrisO::use_immed_bit_default, XorrisO::volid, XorrisO::volid_default, XorrisO::volset_id, Xorriso__bourne_to_reg(), Xorriso__read_pacifier(), Xorriso_alloc_meM, Xorriso_assert_volid(), Xorriso_auto_driveadr(), Xorriso_create_empty_iso(), Xorriso_destroy_di_array(), Xorriso_destroy_hln_array(), Xorriso_free_meM, Xorriso_get_drive_handles(), Xorriso_give_up_drive(), Xorriso_grasp_loaded_aaip(), Xorriso_info(), Xorriso_msgs_submit(), Xorriso_pacifier_callback(), Xorriso_pacifier_reset(), Xorriso_process_msg_queues(), Xorriso_record_boot_info(), Xorriso_set_abort_severity(), Xorriso_set_data_cache(), Xorriso_set_image_severities(), Xorriso_set_speed(), Xorriso_toc(), and Xorriso_update_volid().

Referenced by Xorriso_option_dev(), and Xorriso_reaquire_outdev().

◆ Xorriso_atip()

◆ Xorriso_auto_driveadr()

◆ Xorriso_check_for_abort()

int Xorriso_check_for_abort ( struct XorrisO xorriso,
char *  abort_file_path,
double  post_read_time,
double *  last_abort_file_time,
int  flag 
)

◆ Xorriso_check_interval()

int Xorriso_check_interval ( struct XorrisO xorriso,
struct SpotlisT spotlist,
struct CheckmediajoB job,
int  from_lba,
int  block_count,
int  read_chunk,
int  md5_start,
int  flag 
)

Definition at line 2807 of file drive_mgt.c.

References CheckmediajoB::abort_file_path, CheckmediajoB::async_chunks, burn_disc_get_profile(), burn_drive_get_drive_role(), burn_nominal_slowdown(), burn_read_data(), xorriso_md5_state::chain_broken, xorriso_md5_state::chunk, xorriso_md5_state::chunk_fill, xorriso_md5_state::chunk_lba, xorriso_md5_state::chunk_r_idx, xorriso_md5_state::chunk_size, xorriso_md5_state::chunk_state, xorriso_md5_state::chunk_w_idx, xorriso_md5_state::ctx, CheckmediajoB::data_to_fd, CheckmediajoB::data_to_limit, CheckmediajoB::data_to_offset, CheckmediajoB::data_to_path, CheckmediajoB::data_to_skip, xorriso_md5_state::in_track_gap, XorrisO::info_text, iso_md5_end(), iso_md5_start(), CheckmediajoB::item_limit, XorrisO::last_update_time, xorriso_md5_state::md5_spot_lba, xorriso_md5_state::md5_spot_value, xorriso_md5_state::md5_start, xorriso_md5_state::next_tag, xorriso_md5_state::num_chunks, XorrisO::pacifier_count, XorrisO::pacifier_interval, XorrisO::pacifier_total, xorriso_md5_state::r_sleeps, XorrisO::read_speed, XorrisO::read_speed_corr, XorrisO::read_speed_force, CheckmediajoB::retry, CheckmediajoB::sector_map, Sectorbitmap_get_layout(), Sectorbitmap_is_set(), Sfile_microtime(), xorriso_md5_state::slave_state, CheckmediajoB::slow_threshold_seq, xorriso_md5_state::spot_mutex, xorriso_md5_state::spotlist, Spotlist_count(), CheckmediajoB::start_time, Text_shellsafe(), CheckmediajoB::time_limit, CheckmediajoB::use_dev, xorriso_md5_state::w_sleeps, xorriso_md5_state::was_sb_tag, xorriso_md5_state::xorriso, Xorriso__add_spot(), Xorriso__end_slave_md5(), Xorriso__wait_chunk_md5(), Xorriso_alloc_meM, Xorriso_check_for_abort(), Xorriso_chunk_md5(), Xorriso_eval_problem_status(), Xorriso_free_meM, Xorriso_get_drive_handles(), Xorriso_msgs_submit(), Xorriso_no_malloc_memory(), Xorriso_pacifier_callback(), Xorriso_process_msg_queues(), Xorriso_read_quality_gooD, Xorriso_read_quality_md5_mismatcH, Xorriso_read_quality_partiaL, Xorriso_read_quality_sloW, Xorriso_read_quality_tao_enD, Xorriso_read_quality_unreadablE, Xorriso_read_quality_untesteD, Xorriso_read_quality_valiD, Xorriso_set_speed(), and Xorriso_start_chunk_md5().

Referenced by Xorriso_check_media(), and Xorriso_read_file_data().

◆ Xorriso_check_md5_range()

◆ Xorriso_check_media()

int Xorriso_check_media ( struct XorrisO xorriso,
struct SpotlisT **  spotlist,
struct CheckmediajoB job,
int  flag 
)

Definition at line 3213 of file drive_mgt.c.

References BURN_DISC_APPENDABLE, burn_disc_free_multi_caps(), BURN_DISC_FULL, burn_disc_get_multi_caps(), burn_disc_get_profile(), burn_get_read_capacity(), BURN_WRITE_NONE, CheckmediajoB::data_to_fd, CheckmediajoB::data_to_path, XorrisO::do_md5, burn_toc_entry::extensions_valid, XorrisO::info_text, isoburn_disc_get_status(), isoburn_get_attached_start_lba(), isoburn_read_iso_head(), isoburn_toc_disc_free(), isoburn_toc_disc_get_sectors(), isoburn_toc_disc_get_sessions(), isoburn_toc_drive_get_disc(), isoburn_toc_session_get_tracks(), isoburn_toc_track_get_entry(), CheckmediajoB::map_with_volid, CheckmediajoB::max_lba, xorriso_md5_state::md5_start, CheckmediajoB::min_block_size, CheckmediajoB::min_lba, CheckmediajoB::mode, XorrisO::pacifier_count, XorrisO::pacifier_total, CheckmediajoB::sector_map, CheckmediajoB::sector_map_path, Sectorbitmap_destroy(), Sectorbitmap_from_file(), Sectorbitmap_to_file(), Spotlist_add_item(), Spotlist_count(), Spotlist_destroy(), Spotlist_get_item(), Spotlist_new(), burn_multi_caps::start_adr, burn_toc_entry::start_lba, CheckmediajoB::start_time, burn_toc_entry::track_blocks, CheckmediajoB::use_dev, Xorriso_check_interval(), Xorriso_get_drive_handles(), Xorriso_msgs_submit(), Xorriso_open_job_data_to(), Xorriso_pacifier_callback(), Xorriso_pacifier_reset(), Xorriso_process_msg_queues(), Xorriso_read_quality_off_tracK, Xorriso_read_quality_tao_enD, Xorriso_read_quality_unreadablE, Xorriso_read_quality_untesteD, Xorriso_spotlist_to_sectormap(), Xorriso_toc_to_string(), and Xorriso_update_in_sector_map().

Referenced by Xorriso_option_check_media().

◆ Xorriso_check_session_md5()

int Xorriso_check_session_md5 ( struct XorrisO xorriso,
char *  severity,
int  flag 
)

◆ Xorriso_choose_speed_factor()

int Xorriso_choose_speed_factor ( struct XorrisO xorriso,
int  speed,
int  profile,
struct burn_drive drive,
double *  speed_factor,
char **  speed_unit,
int  flag 
)

Definition at line 1728 of file drive_mgt.c.

References burn_drive_get_all_profiles(), and burn_drive::num_profiles.

Referenced by Xorriso_list_speeds_sub().

◆ Xorriso_chunk_md5()

◆ Xorriso_drive_snooze()

int Xorriso_drive_snooze ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_get_drive_handles()

◆ Xorriso_get_profile()

int Xorriso_get_profile ( struct XorrisO xorriso,
int *  profile_number,
char  profile_name[80],
int  flag 
)

◆ Xorriso_give_up_drive()

◆ Xorriso_grasp_loaded_aaip()

static int Xorriso_grasp_loaded_aaip ( struct XorrisO xorriso,
IsoImage volset,
int  flag 
)
static

◆ Xorriso_list_formats()

◆ Xorriso_list_profiles()

int Xorriso_list_profiles ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_list_speeds()

int Xorriso_list_speeds ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_list_speeds_sub()

◆ Xorriso_may_burn()

◆ Xorriso_media_product()

int Xorriso_media_product ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_msinfo()

◆ Xorriso_obtain_indev_readsize()

int Xorriso_obtain_indev_readsize ( struct XorrisO xorriso,
uint32_t *  blocks,
int  flag 
)

◆ Xorriso_pretend_full_disc()

int Xorriso_pretend_full_disc ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_reaquire_outdev()

◆ Xorriso_scsi_dev_family()

int Xorriso_scsi_dev_family ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_scsi_log()

int Xorriso_scsi_log ( struct XorrisO xorriso,
int  flag 
)

Definition at line 2356 of file drive_mgt.c.

References burn_set_scsi_logging().

Referenced by Xorriso_option_scsi_log().

◆ Xorriso_set_speed()

int Xorriso_set_speed ( struct XorrisO xorriso,
struct burn_drive drive,
int  read_speed,
int  write_speed,
int  flag 
)

◆ Xorriso_show_devices()

◆ Xorriso_start_chunk_md5()

int Xorriso_start_chunk_md5 ( struct XorrisO xorriso,
struct xorriso_md5_state state,
int  flag 
)

◆ Xorriso_tell_media_space()

int Xorriso_tell_media_space ( struct XorrisO xorriso,
int *  media_space,
int *  free_space,
int  flag 
)

◆ Xorriso_toc()

int Xorriso_toc ( struct XorrisO xorriso,
int  flag 
)

Definition at line 1033 of file drive_mgt.c.

References BURN_DISC_APPENDABLE, BURN_DISC_BLANK, BURN_DISC_EMPTY, burn_disc_free_multi_caps(), BURN_DISC_FULL, burn_disc_get_formats(), burn_disc_get_multi_caps(), burn_disc_get_phys_format_info(), burn_disc_get_profile(), burn_disc_next_track_is_damaged(), burn_disc_read_atip(), burn_disc_track_lba_nwa(), burn_drive_get_bd_r_pow(), burn_drive_get_drive_role(), burn_drive_get_media_sno(), burn_drive_get_serial_no(), burn_drive_get_start_end_lba(), BURN_FORMAT_IS_FORMATTED, burn_get_read_capacity(), burn_msf_to_lba(), BURN_WRITE_TAO, burn_toc_entry::control, isoburn_toc_disc::disc, burn_drive::drive_role, burn_drive::end_lba, burn_toc_entry::extensions_valid, XorrisO::indev, XorrisO::indev_access, XorrisO::indev_is_exclusive, XorrisO::info_text, isoburn_disc_available_space(), isoburn_disc_get_status(), isoburn_disc_track_lba_nwa(), isoburn_get_min_start_byte(), isoburn_read_iso_head(), isoburn_toc_disc_free(), isoburn_toc_disc_get_incmpl_sess(), isoburn_toc_disc_get_sessions(), isoburn_toc_drive_get_disc(), isoburn_toc_session_get_leadout_entry(), isoburn_toc_session_get_tracks(), isoburn_toc_track_get_emul(), isoburn_toc_track_get_entry(), XorrisO::isofs_has_what, XorrisO::isofs_size, burn_drive::nwa, XorrisO::outdev, XorrisO::outdev_access, XorrisO::outdev_is_exclusive, burn_toc_entry::pframe, burn_toc_entry::pmin, burn_toc_entry::psec, XorrisO::request_to_abort, XorrisO::result_line, XorrisO::rr_loaded, Sfile_scale(), burn_toc_entry::start_lba, burn_drive::start_lba, burn_drive::status, burn_toc_entry::track_blocks, XorrisO::tree_loaded, Xorriso_get_drive_handles(), Xorriso_media_product(), Xorriso_msgs_submit(), Xorriso_process_msg_queues(), Xorriso_show_boot_info(), and Xorriso_toc_line().

Referenced by Xorriso_aquire_drive(), Xorriso_give_up_drive(), Xorriso_list_formats(), Xorriso_list_speeds_sub(), Xorriso_option_list_profiles(), Xorriso_option_toc(), Xorriso_option_toc_of(), Xorriso_pvd_info(), and Xorriso_toc_to_string().

◆ Xorriso_toc_line()

int Xorriso_toc_line ( struct XorrisO xorriso,
int  flag 
)

◆ Xorriso_toc_to_string()

int Xorriso_toc_to_string ( struct XorrisO xorriso,
char **  toc_text,
int  flag 
)

◆ Xorriso_use_immed_bit()

int Xorriso_use_immed_bit ( struct XorrisO xorriso,
int  flag 
)