|
|
|
@ -58,7 +58,7 @@ struct isoburn_read_opts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Writing of result images is controlled by libisofs related parameters |
|
|
|
|
in struct isoburn_source_opts |
|
|
|
|
in struct isoburn_imgen_opts |
|
|
|
|
|
|
|
|
|
>>> which the application obtains from libisoburn. |
|
|
|
|
|
|
|
|
@ -175,6 +175,10 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* >>> this goes to isoburn.h */ |
|
|
|
|
|
|
|
|
|
/* >>> Opaque definition of isoburn_read_opts */ |
|
|
|
|
/* >>> Constructor, destructor, getters, setters. */ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Options for image reading. |
|
|
|
|
*/ |
|
|
|
@ -214,119 +218,168 @@ struct isoburn_read_opts {
|
|
|
|
|
unsigned int pretend_blank:1; /* always create empty image */ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* >>> this goes to isoburn.h */ |
|
|
|
|
/**
|
|
|
|
|
* Options for image generation by libisofs and image transport to libburn. |
|
|
|
|
*/ |
|
|
|
|
struct isoburn_source_opts { |
|
|
|
|
|
|
|
|
|
/* Options for image generation */ |
|
|
|
|
|
|
|
|
|
int level; /**< ISO level to write at. */ |
|
|
|
|
|
|
|
|
|
/** Which extensions to support. */ |
|
|
|
|
unsigned int rockridge :1; |
|
|
|
|
unsigned int joliet :1; |
|
|
|
|
unsigned int iso1999 :1; |
|
|
|
|
|
|
|
|
|
/* relaxed constraints */ |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Relaxed constraints. Setting any of these to 1 break the specifications, |
|
|
|
|
* but it is supposed to work on most moderns systems. Use with caution. |
|
|
|
|
*/ |
|
|
|
|
/* ----------------------------------------------------------------------- */ |
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Omit the version number (";1") at the end of the ISO-9660 identifiers. |
|
|
|
|
* Version numbers are usually not used. |
|
|
|
|
*/ |
|
|
|
|
unsigned int omit_version_numbers :1; |
|
|
|
|
Options for image generation by libisofs and image transport to libburn. |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow ISO-9660 directory hierarchy to be deeper than 8 levels. |
|
|
|
|
*/ |
|
|
|
|
unsigned int allow_deep_paths :1; |
|
|
|
|
An application shall create an option set object by isoburn_igopt_new(), |
|
|
|
|
program it by isoburn_igopt_set_*(), use it with either |
|
|
|
|
isoburn_prepare_new_image() or isoburn_prepare_disc(), and finally delete |
|
|
|
|
it by isoburn_igopt_destroy(). |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow path in the ISO-9660 tree to have more than 255 characters. |
|
|
|
|
*/ |
|
|
|
|
unsigned int allow_longer_paths :1; |
|
|
|
|
*/ |
|
|
|
|
/* ----------------------------------------------------------------------- */ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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. |
|
|
|
|
*/ |
|
|
|
|
unsigned int max_37_char_filenames :1; |
|
|
|
|
struct isoburn_imgen_opts; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ISO-9660 forces filenames to have a ".", that separates file name from |
|
|
|
|
* extension. libisofs adds it if original filename doesn't has one. Set |
|
|
|
|
* this to 1 to prevent this behavior |
|
|
|
|
*/ |
|
|
|
|
unsigned int no_force_dots :1; |
|
|
|
|
/** Produces a set of generation and transfer options, initialized with default
|
|
|
|
|
values. |
|
|
|
|
@param o the newly created option set object |
|
|
|
|
@return 1=ok , <0 = failure |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_new(struct isoburn_imgen_opts **o, int flag); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow lowercase characters in ISO-9660 filenames. By default, only |
|
|
|
|
* uppercase characters, numbers and a few other characters are allowed. |
|
|
|
|
*/ |
|
|
|
|
unsigned int allow_lowercase :1; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow all ASCII characters to be appear on an ISO-9660 filename. Note |
|
|
|
|
* that "/" and "\0" characters are never allowed, even in RR names. |
|
|
|
|
*/ |
|
|
|
|
unsigned int allow_full_ascii :1; |
|
|
|
|
/** Deletes an option set which was created by isoburn_igopt_new().
|
|
|
|
|
It is harmless to submit *o == NULL. |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allow paths in the Joliet tree to have more than 240 characters. |
|
|
|
|
*/ |
|
|
|
|
unsigned int joliet_longer_paths :1; |
|
|
|
|
|
|
|
|
|
unsigned int sort_files:1; |
|
|
|
|
/**< If files should be sorted based on their weight. */ |
|
|
|
|
/** ISO level to write at.
|
|
|
|
|
>>> what is an ISO level ? xorriso uses 2. |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level); |
|
|
|
|
int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The following options set the default values for files and directory |
|
|
|
|
* permissions, gid and uid. All these take one of three values: 0, 1 or 2. |
|
|
|
|
* If 0, the corresponding attribute will be kept as set in the IsoNode. |
|
|
|
|
* Unless you have changed it, it corresponds to the value on disc, so it |
|
|
|
|
* is suitable for backup purposes. If set to 1, the corresponding attrib. |
|
|
|
|
* will be changed by a default suitable value. Finally, if you set it to |
|
|
|
|
* 2, the attrib. will be changed with the value specified in the options |
|
|
|
|
* below. Note that for mode attributes, only the permissions are set, the |
|
|
|
|
* file type remains unchanged. |
|
|
|
|
*/ |
|
|
|
|
unsigned int replace_dir_mode :2;
|
|
|
|
|
unsigned int replace_file_mode :2; |
|
|
|
|
unsigned int replace_uid :2; |
|
|
|
|
unsigned int replace_gid :2; |
|
|
|
|
|
|
|
|
|
mode_t dir_mode; /** Mode to use on dirs when replace_dir_mode == 2. */ |
|
|
|
|
mode_t file_mode; /** Mode to use on files when replace_file_mode == 2. */ |
|
|
|
|
uid_t uid; /** uid to use when replace_uid == 2. */ |
|
|
|
|
gid_t gid; /** gid to use when replace_gid == 2. */ |
|
|
|
|
|
|
|
|
|
char *output_charset; /**< NULL to use default charset */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Options for image transport */ |
|
|
|
|
|
|
|
|
|
/** 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). |
|
|
|
|
*/ |
|
|
|
|
int fifo_size; |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
/** Which extensions to support.
|
|
|
|
|
@param ext Bitfield: bit0= rockridge, bit1= joliet, bit2= iso1999 |
|
|
|
|
*/ |
|
|
|
|
#define isoburn_igopt_rockridge 1 |
|
|
|
|
#define isoburn_igopt_joliet 2 |
|
|
|
|
#define isoburn_igopt_iso1999 4 |
|
|
|
|
int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext); |
|
|
|
|
int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext); |
|
|
|
|
|
|
|
|
|
/** 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. |
|
|
|
|
@param relax Bitfield: |
|
|
|
|
bit0= omit_version_numbers |
|
|
|
|
Omit the version number (";1") at the end of the |
|
|
|
|
ISO-9660 identifiers. Version numbers are usually |
|
|
|
|
not used. |
|
|
|
|
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. |
|
|
|
|
*/ |
|
|
|
|
#define isoburn_igopt_omit_version_numbers 1 |
|
|
|
|
#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 |
|
|
|
|
int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax); |
|
|
|
|
int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Whether and how files should be sorted.
|
|
|
|
|
@param value Bitfield: bit0= sort_files_by_weight |
|
|
|
|
files should be sorted based on their weight. |
|
|
|
|
>>> what is weight ? |
|
|
|
|
*/ |
|
|
|
|
#define isoburn_igopt_sort_files_by_weight 1 |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 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. |
|
|
|
|
@param replace_dir_mode whether and how to override directories |
|
|
|
|
@param replace_file_mode whether and how to override files of other type |
|
|
|
|
@param dir_mode Mode to use on dirs with replace_dir_mode == 2. |
|
|
|
|
@param file_mode; Mode to use on files with replace_file_mode == 2. |
|
|
|
|
*/ |
|
|
|
|
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); |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
/** 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. |
|
|
|
|
@param replace_uid whether and how to override user ids |
|
|
|
|
@param replace_gid whether and how to override group ids |
|
|
|
|
@param uid User id to use with replace_uid == 2. |
|
|
|
|
@param gid Group id to use on files with replace_gid == 2. |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o, |
|
|
|
|
int replace_uid, int replace_gid, |
|
|
|
|
uid_t uid, gid_t gid); |
|
|
|
|
int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o, |
|
|
|
|
int *replace_uid, int *replace_gid, |
|
|
|
|
uid_t *uid, gid_t *gid); |
|
|
|
|
|
|
|
|
|
/** Set this to NULL to use the default charset.
|
|
|
|
|
>>> What if not NULL or not want default ? |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o, |
|
|
|
|
char *output_charset); |
|
|
|
|
int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o, |
|
|
|
|
char **output_charset); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 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). |
|
|
|
|
*/ |
|
|
|
|
int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size); |
|
|
|
|
int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size); |
|
|
|
|
|
|
|
|
|
/* >>> Opaque definitions of isoburn_read_opts and isoburn_source_opts */ |
|
|
|
|
/* >>> Constructors, destructors, getters, setters. */ |
|
|
|
|
/* >>> Learn what libisofs does */ |
|
|
|
|
/* ----------------------------------------------------------------------- */ |
|
|
|
|
/* End of Options for image generation */ |
|
|
|
|
/* ----------------------------------------------------------------------- */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Get the image attached to a drive, if any.
|
|
|
|
@ -422,7 +475,7 @@ int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte,
|
|
|
|
|
@return <=0 error , 1 = success |
|
|
|
|
*/ |
|
|
|
|
int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc, |
|
|
|
|
struct isoburn_source_opts *opts); |
|
|
|
|
struct isoburn_imgen_opts *opts); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Create a disc object for producing a new image from a previous image
|
|
|
|
@ -447,7 +500,7 @@ int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc,
|
|
|
|
|
*/ |
|
|
|
|
int isoburn_prepare_new_image(struct burn_drive *in_drive, |
|
|
|
|
struct burn_disc **disc, |
|
|
|
|
struct isoburn_source_opts *opts, |
|
|
|
|
struct isoburn_imgen_opts *opts, |
|
|
|
|
struct burn_drive *out_drive); |
|
|
|
|
|
|
|
|
|
/** Start writing of the new session.
|
|
|
|
|