#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <libburn/libburn.h>
#include <libisofs/libisofs.h>
#include "libisoburn.h"
#include "isoburn.h"
Go to the source code of this file.
Functions | |
int | isoburn_toc_entry_new (struct isoburn_toc_entry **objpt, struct isoburn_toc_entry *boss, int flag) |
int | isoburn_toc_entry_destroy (struct isoburn_toc_entry **o, int flag) |
int | isoburn_new (struct isoburn **objpt, int flag) |
int | isoburn_destroy (struct isoburn **objpt, int flag) |
int | isoburn_destroy_all (struct isoburn **objpt, int flag) |
int | isoburn_get_target_image (struct isoburn *o, IsoImage **pt, int flag) |
int | isoburn_get_prev (struct isoburn *o, struct isoburn **pt, int flag) |
int | isoburn_get_next (struct isoburn *o, struct isoburn **pt, int flag) |
int | isoburn_link (struct isoburn *o, struct isoburn *link, int flag) |
int | isoburn_count (struct isoburn *o, int flag) |
int | isoburn_by_idx (struct isoburn *o, int idx, struct isoburn **pt, int flag) |
int | isoburn_find_by_drive (struct isoburn **pt, struct burn_drive *d, int flag) |
int | isoburn_msgs_submit (struct isoburn *o, int error_code, char msg_text[], int os_errno, char severity[], int flag) |
static int | isoburn_prepare_disc_aux (struct burn_drive *in_d, struct burn_drive *out_d, struct burn_disc **disc, struct isoburn_imgen_opts *opts, int flag) |
int | isoburn_prepare_disc (struct burn_drive *d, 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 *d, 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 *d, 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 *d, struct burn_drive *output_drive, int flag) |
Revoke isoburn_prepare_*() instead of running isoburn_disc_write(). | |
int | isoburn_sync_after_write (struct burn_drive *d, 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_version (int *major, int *minor, int *micro) |
Obtain the three release version numbers of the library. | |
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. | |
int | isoburn_ropt_new (struct isoburn_read_opts **new_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 **new_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 *opts, 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 *opts, char data[32768], int *options) |
int | isoburn_igopt_set_pvd_times (struct isoburn_imgen_opts *opts, time_t vol_creation_time, time_t vol_modification_time, time_t vol_expiration_time, time_t vol_effective_time, char *vol_uuid) |
Explicitely set the four timestamps of the emerging ISO image. | |
int | isoburn_igopt_get_pvd_times (struct isoburn_imgen_opts *opts, time_t *vol_creation_time, time_t *vol_modification_time, time_t *vol_expiration_time, time_t *vol_effective_time, char vol_uuid[17]) |
Variables | |
int(* | libisoburn_default_msgs_submit )(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag) = NULL |
void * | libisoburn_default_msgs_submit_handle = NULL |
int | libisoburn_default_msgs_submit_flag = 0 |
struct isoburn * | isoburn_list_start = NULL |
Definition at line 282 of file isoburn.c.
References isoburn::next, and isoburn::prev.
: bit0= fetch first (idx<0) or last (idx>0) item in list bit1= address from start of list */ { int i,abs_idx; struct isoburn *npt; if(flag&2) for(;o->prev!=NULL;o= o->prev); abs_idx= (idx>0?idx:-idx); *pt= o; for(i= 0;(i<abs_idx || (flag&1)) && *pt!=NULL;i++) { if(idx>0) npt= o->next; else npt= o->prev; if(npt==NULL && (flag&1)) break; *pt= npt; } return(*pt!=NULL); }
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); }
int isoburn_count | ( | struct isoburn * | o, | |
int | flag | |||
) |
Definition at line 269 of file isoburn.c.
References isoburn::next, and isoburn::prev.
int isoburn_destroy | ( | struct isoburn ** | objpt, | |
int | flag | |||
) |
Definition at line 160 of file isoburn.c.
References isoburn::image, isoburn::iso_data_source, isoburn::iso_source, isoburn_toc_entry_destroy(), isoburn::next, isoburn::prev, and isoburn::toc.
Referenced by isoburn_destroy_all(), isoburn_drive_aquire(), isoburn_drive_grab(), isoburn_drive_release(), and isoburn_new().
{ struct isoburn *o; o= *objpt; if(o==NULL) return(0); /* >>> mutex */ if(o==isoburn_list_start) isoburn_list_start= o->next; if(o->prev!=NULL) o->prev->next= o->next; if(o->next!=NULL) o->next->prev= o->prev; /* >>> end mutex */ if(o->image!=NULL) iso_image_unref(o->image); if(o->toc!=NULL) isoburn_toc_entry_destroy(&(o->toc), 1); /* all */ if(o->iso_source!=NULL) burn_source_free(o->iso_source); if(o->iso_data_source!=NULL) iso_data_source_unref(o->iso_data_source); free((char *) o); *objpt= NULL; return(1); }
int isoburn_destroy_all | ( | struct isoburn ** | objpt, | |
int | flag | |||
) |
Definition at line 193 of file isoburn.c.
References isoburn_destroy(), isoburn::next, and isoburn::prev.
Referenced by isoburn_finish(), and isoburn_initialize().
{ struct isoburn *o,*n; o= *objpt; if(o==NULL) return(0); for(;o->prev!=NULL;o= o->prev); for(;o!=NULL;o= n) { n= o->next; isoburn_destroy(&o,0); } *objpt= NULL; return(1); }
int isoburn_find_by_drive | ( | struct isoburn ** | pt, | |
struct burn_drive * | d, | |||
int | flag | |||
) |
Definition at line 306 of file isoburn.c.
References isoburn::drive, and isoburn::next.
Referenced by isoburn_find_emulator().
{ struct isoburn *o; *pt= NULL; for(o= isoburn_list_start;o!=NULL;o= o->next) if(o->drive==d) { *pt= o; return(1); } return(0); }
int isoburn_get_target_image | ( | struct isoburn * | o, | |
IsoImage ** | pt, | |||
int | flag | |||
) |
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 * | vol_creation_time, | |||
time_t * | vol_modification_time, | |||
time_t * | vol_expiration_time, | |||
time_t * | vol_effective_time, | |||
char | vol_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 * | opts, | |
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_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)))); }
Definition at line 231 of file isoburn.c.
References isoburn::next, and isoburn::prev.
Referenced by isoburn_new().
{ /* >>> mutex */ if(isoburn_list_start==NULL || (isoburn_list_start==link && (flag&1))) isoburn_list_start= o; if(o->prev!=NULL) o->prev->next= o->next; if(o->next!=NULL) o->next->prev= o->prev; o->prev= o->next= NULL; if(link==NULL) return(1); if(flag&1) { o->next= link; o->prev= link->prev; if(o->prev!=NULL) o->prev->next= o; link->prev= o; } else { o->prev= link; o->next= link->next; if(o->next!=NULL) o->next->prev= o; link->next= o; } /* >>> end mutex */ return(1); }
int isoburn_msgs_submit | ( | struct isoburn * | o, | |
int | error_code, | |||
char | msg_text[], | |||
int | os_errno, | |||
char | severity[], | |||
int | flag | |||
) |
Definition at line 320 of file isoburn.c.
References libisoburn_default_msgs_submit, libisoburn_default_msgs_submit_flag, libisoburn_default_msgs_submit_handle, isoburn::msgs_submit, isoburn::msgs_submit_flag, and isoburn::msgs_submit_handle.
Referenced by ds_read_block(), isoburn_attach_image(), isoburn_disc_get_msc1(), isoburn_disc_write(), isoburn_emulate_toc(), isoburn_find_emulator(), isoburn_igopt_new(), isoburn_make_toc_entry(), isoburn_new(), isoburn_prepare_disc_aux(), isoburn_read_image(), isoburn_read_iso_head_parse(), isoburn_ropt_new(), isoburn_set_msc1(), isoburn_set_start_byte(), isoburn_start_emulation(), isoburn_toc_entry_new(), and isoburn_welcome_media().
{ int ret, use_drive_method= 0; if(o!=NULL) if(o->msgs_submit!=NULL) use_drive_method= 1; if(use_drive_method) { ret= o->msgs_submit(o->msgs_submit_handle, error_code, msg_text, os_errno, severity, o->msgs_submit_flag); return(ret); } if(libisoburn_default_msgs_submit != NULL) { ret= libisoburn_default_msgs_submit(libisoburn_default_msgs_submit_handle, error_code, msg_text, os_errno, severity, libisoburn_default_msgs_submit_flag); return(ret); } /* Fallback: use message queue of libburn */ burn_msgs_submit(error_code, msg_text, os_errno, severity, NULL); return(1); }
int isoburn_new | ( | struct isoburn ** | objpt, | |
int | flag | |||
) |
Definition at line 111 of file isoburn.c.
References isoburn::drive, isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn::fabricated_msc1, isoburn::fabricated_msc2, isoburn::image, isoburn::iso_data_source, isoburn::iso_source, isoburn_destroy(), isoburn_link(), isoburn_msgs_submit(), isoburn_report_iso_error(), isoburn::min_start_byte, isoburn::msgs_submit, isoburn::msgs_submit_flag, isoburn::msgs_submit_handle, isoburn::next, isoburn::nwa, isoburn::prev, isoburn::read_pacifier, isoburn::read_pacifier_handle, isoburn::target_iso_head, isoburn::toc, isoburn::truncate, isoburn::wrote_well, and isoburn::zero_nwa.
Referenced by isoburn_welcome_media().
{ struct isoburn *o; int i, ret; *objpt= o= (struct isoburn *) malloc(sizeof(struct isoburn)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for isoburn control object", 0, "FATAL", 0); return(-1); } o->drive= NULL; o->emulation_mode= 0; o->fabricated_msc1= -1; o->fabricated_msc2= -1; o->zero_nwa= Libisoburn_overwriteable_starT; o->min_start_byte= o->zero_nwa * 2048; o->nwa= o->zero_nwa; o->truncate= 0; o->iso_source= NULL; o->fabricated_disc_status= BURN_DISC_UNREADY; o->toc= NULL; o->wrote_well= -1; for(i=0;i<Libisoburn_target_head_sizE;i++) o->target_iso_head[i]= 0; o->image= NULL; o->iso_data_source= NULL; o->read_pacifier= NULL; o->read_pacifier_handle= NULL; o->msgs_submit= NULL; o->msgs_submit_handle= NULL; o->msgs_submit_flag= 0; o->prev= NULL; o->next= NULL; ret= iso_image_new("ISOIMAGE", &o->image); if(ret<0) { isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0); goto failed; } isoburn_link(o, isoburn_list_start, 1); return(1); failed:; isoburn_destroy(objpt, 0); return(-1); }
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); }
static int isoburn_prepare_disc_aux | ( | struct burn_drive * | in_d, | |
struct burn_drive * | out_d, | |||
struct burn_disc ** | disc, | |||
struct isoburn_imgen_opts * | opts, | |||
int | flag | |||
) | [static] |
Definition at line 350 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_md5, isoburn_imgen_opts::file_mode, isoburn_imgen_opts::gid, isoburn_imgen_opts::hardlinks, isoburn::image, isoburn_imgen_opts::iso1999, isoburn::iso_data_source, isoburn::iso_source, isoburn_data_source_shutdown(), isoburn_disc_get_status(), isoburn_disc_track_lba_nwa(), isoburn_find_emulator(), isoburn_get_msc2(), isoburn_msgs_submit(), isoburn_report_iso_error(), 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::nwa, 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::scdbackup_tag_name, isoburn_imgen_opts::scdbackup_tag_time, isoburn_imgen_opts::scdbackup_tag_written, isoburn_imgen_opts::session_md5, isoburn_imgen_opts::sort_files, isoburn_imgen_opts::system_area_data, isoburn_imgen_opts::system_area_options, isoburn::target_iso_head, isoburn_imgen_opts::uid, isoburn_imgen_opts::vol_creation_time, isoburn_imgen_opts::vol_effective_time, isoburn_imgen_opts::vol_expiration_time, isoburn_imgen_opts::vol_modification_time, isoburn_imgen_opts::vol_uuid, and isoburn::wrote_well.
Referenced by isoburn_prepare_blind_grow(), isoburn_prepare_disc(), and isoburn_prepare_new_image().
{ struct burn_source *wsrc; struct burn_session *session; struct burn_track *track; struct isoburn *in_o, *out_o; IsoWriteOpts *wopts= NULL; enum burn_disc_status state; int ret, fifo_chunks, lba, nwa, i, new_img, early_indev_release; uint32_t data_start= -1; size_t buffer_size= 0, buffer_free= 0; char msg[160]; new_img= flag&1; early_indev_release= flag&2; ret= isoburn_find_emulator(&in_o, in_d, 0); if(ret<0 || in_o==NULL) {ret= -1; goto ex;} ret= isoburn_find_emulator(&out_o, out_d, 0); if(ret<0 || out_o==NULL) {ret= -1; goto ex;} /* early end will be registered as failure */ in_o->wrote_well= out_o->wrote_well= 0; if(new_img && early_indev_release) { isoburn_msgs_submit(in_o, 0x00060000, "Programming error: Wrong session setup: new_img && early_indev_release", 0, "FATAL", 0); {ret= -4; goto ex;} } state = isoburn_disc_get_status(in_d); if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE && state != BURN_DISC_FULL) { isoburn_msgs_submit(in_o, 0x00060000, "Unsuitable source media state", 0, "FAILURE", 0); {ret= -2; goto ex;} } state = isoburn_disc_get_status(out_d); if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) { isoburn_msgs_submit(out_o, 0x00060000, "Unsuitable target media state", 0, "FAILURE", 0); {ret= -2; goto ex;} } fifo_chunks= 32; if(opts->fifo_size >= 64*1024 && opts->fifo_size <= 1024.0 * 1024.0 * 1024.0){ fifo_chunks= opts->fifo_size/2048; if(fifo_chunks*2048 < opts->fifo_size) fifo_chunks++; } ret = iso_write_opts_new(&wopts, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create iso_write_opts", 0, "FATAL",0); goto ex; } iso_write_opts_set_iso_level(wopts, opts->level); iso_write_opts_set_rockridge(wopts, opts->rockridge); iso_write_opts_set_joliet(wopts, opts->joliet); iso_write_opts_set_iso1999(wopts, opts->iso1999); /* <<< #ifdef shall be removed when libisofs-0.6.20 is released */ #ifdef Libisofs_hardlink_prooF iso_write_opts_set_hardlinks(wopts, opts->hardlinks); if(opts->hardlinks) iso_write_opts_set_rrip_1_10_px_ino(wopts, 1); #endif iso_write_opts_set_aaip(wopts, opts->aaip); iso_write_opts_set_omit_version_numbers(wopts, opts->omit_version_numbers); iso_write_opts_set_allow_deep_paths(wopts, opts->allow_deep_paths); iso_write_opts_set_allow_longer_paths(wopts, opts->allow_longer_paths); iso_write_opts_set_max_37_char_filenames(wopts, opts->max_37_char_filenames); iso_write_opts_set_no_force_dots(wopts, opts->no_force_dots); iso_write_opts_set_allow_lowercase(wopts, opts->allow_lowercase); iso_write_opts_set_allow_full_ascii(wopts, opts->allow_full_ascii); iso_write_opts_set_relaxed_vol_atts(wopts, 1); iso_write_opts_set_joliet_longer_paths(wopts, opts->joliet_longer_paths); iso_write_opts_set_always_gmt(wopts, opts->always_gmt); iso_write_opts_set_rrip_version_1_10(wopts, opts->rrip_version_1_10); iso_write_opts_set_dir_rec_mtime(wopts, opts->dir_rec_mtime); iso_write_opts_set_aaip_susp_1_10(wopts, opts->aaip_susp_1_10); iso_write_opts_set_sort_files(wopts, opts->sort_files); iso_write_opts_set_record_md5(wopts, opts->session_md5, opts->file_md5 & 3); if(opts->scdbackup_tag_name[0] && opts->scdbackup_tag_time[0]) iso_write_opts_set_scdbackup_tag(wopts, opts->scdbackup_tag_name, opts->scdbackup_tag_time, opts->scdbackup_tag_written); iso_write_opts_set_replace_mode(wopts, opts->replace_dir_mode, opts->replace_file_mode, opts->replace_uid, opts->replace_gid); iso_write_opts_set_default_dir_mode(wopts, opts->dir_mode); iso_write_opts_set_default_file_mode(wopts, opts->file_mode); iso_write_opts_set_default_uid(wopts, opts->uid); iso_write_opts_set_default_gid(wopts, opts->gid); iso_write_opts_set_output_charset(wopts, opts->output_charset); iso_write_opts_set_fifo_size(wopts, fifo_chunks); ret = iso_write_opts_set_system_area(wopts, opts->system_area_data, opts->system_area_options, 0); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot set content of System Area", 0, "FAILURE", 0); {ret= -1; goto ex;} } iso_write_opts_set_pvd_times(wopts, opts->vol_creation_time, opts->vol_modification_time, opts->vol_expiration_time, opts->vol_effective_time, opts->vol_uuid); ret = isoburn_disc_track_lba_nwa(out_d, NULL, 0, &lba, &nwa); opts->effective_lba= nwa; ret= isoburn_get_msc2(out_o, NULL, &nwa, 0); if (ret != 1) { isoburn_msgs_submit(out_o, 0x00060000, "Cannot determine next writeable address", 0, "FAILURE", 0); {ret= -3; goto ex;} } iso_write_opts_set_ms_block(wopts, nwa); iso_write_opts_set_appendable(wopts, !new_img); iso_write_opts_set_overwrite_buf(wopts, nwa>0 ? out_o->target_iso_head : NULL); ret = iso_image_create_burn_source(in_o->image, wopts, &wsrc); if (ret < 0) { isoburn_report_iso_error(ret, "Cannot create burn source", 0, "FAILURE", 0); {ret= -1; goto ex;} } if (early_indev_release) { for(i= 0; i<300; i++) { /* <<< ??? */ if((i%30) == 0) { sprintf(msg, "Waiting for data in fifo since %d seconds", i/30); isoburn_msgs_submit(in_o, 0x00060000, msg, 0, "DEBUG", 0); } usleep(100000); ret= iso_ring_buffer_get_status(wsrc, &buffer_size, &buffer_free); if(ret >0 && buffer_size != buffer_free) break; } /* <<< ??? */ sprintf(msg, "After %.1f seconds: %d bytes of output available (fifo state=%d)", ((double) i+1) / 10.0, (int) (buffer_size - buffer_free), ret); isoburn_msgs_submit(in_o, 0x00060000, msg, 0, "DEBUG", 0); if(in_o->iso_data_source!=NULL) isoburn_data_source_shutdown(in_o->iso_data_source, 0); } ret= iso_write_opts_get_data_start(wopts, &data_start, 0); opts->data_start_lba= -1; if(ret > 0 && data_start <= 0x7FFFFFFF) opts->data_start_lba= data_start; /* TODO check return values for failure. propertly clean-up on error */ out_o->iso_source= wsrc; *disc = burn_disc_create(); session = burn_session_create(); burn_disc_add_session(*disc, session, BURN_POS_END); track = burn_track_create(); burn_track_set_source(track, out_o->iso_source); burn_session_add_track(session, track, BURN_POS_END); /* give up local references */ burn_track_free(track); burn_session_free(session); in_o->wrote_well= out_o->wrote_well= -1; /* neutral */ ret= 1; ex: if(wopts!=NULL) {iso_write_opts_free(wopts); wopts= NULL;} return ret; }
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_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_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); }
int isoburn_toc_entry_destroy | ( | struct isoburn_toc_entry ** | o, | |
int | flag | |||
) |
Definition at line 85 of file isoburn.c.
References isoburn_toc_entry_destroy().
Referenced by isoburn_destroy(), isoburn_emulate_toc(), and isoburn_toc_entry_destroy().
{ if(*o==NULL) return(0); if(flag&1) isoburn_toc_entry_destroy(&((*o)->next), flag); if((*o)->volid != NULL) free((*o)->volid); free((char *) (*o)); *o= NULL; return(1); }
int isoburn_toc_entry_new | ( | struct isoburn_toc_entry ** | objpt, | |
struct isoburn_toc_entry * | boss, | |||
int | flag | |||
) |
Definition at line 56 of file isoburn.c.
References isoburn_msgs_submit(), isoburn_toc_entry::next, isoburn_toc_entry::session, isoburn_toc_entry::start_lba, isoburn_toc_entry::track_blocks, isoburn_toc_entry::track_no, and isoburn_toc_entry::volid.
Referenced by isoburn_make_toc_entry().
{ struct isoburn_toc_entry *o, *s; *objpt= o= (struct isoburn_toc_entry *) malloc(sizeof(struct isoburn_toc_entry)); if(o==NULL) { isoburn_msgs_submit(NULL, 0x00060000, "Cannot allocate memory for isoburn toc entry", 0, "FATAL", 0); return(-1); } o->session= 0; o->track_no= 0; o->start_lba= -1; o->track_blocks= 0; o->volid= NULL; o->next= NULL; if(boss!=NULL) { for(s= boss; s->next!=NULL; s= s->next); s->next= o; } return(1); }
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; */ }
struct isoburn* isoburn_list_start = NULL |
int(* libisoburn_default_msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag) = NULL |
Definition at line 47 of file isoburn.c.
Referenced by isoburn_msgs_submit(), isoburn_set_msgs_submit(), and isoburn_welcome_media().
Definition at line 50 of file isoburn.c.
Referenced by isoburn_msgs_submit(), isoburn_set_msgs_submit(), and isoburn_welcome_media().
void* libisoburn_default_msgs_submit_handle = NULL |
Definition at line 49 of file isoburn.c.
Referenced by isoburn_msgs_submit(), isoburn_set_msgs_submit(), and isoburn_welcome_media().