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.
![]() ![]() |
#include "libisofs.h"
#include "image.h"
#include "node.h"
#include "messages.h"
#include "eltorito.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
int | iso_imported_sa_new (struct iso_imported_sys_area **boots, int flag) |
int | iso_imported_sa_unref (struct iso_imported_sys_area **boots, int flag) |
int | iso_image_new (const char *name, IsoImage **image) |
void | iso_image_ref (IsoImage *image) |
void | iso_image_unref (IsoImage *image) |
int | iso_image_free_checksums (IsoImage *image, int flag) |
int | iso_image_attach_data (IsoImage *image, void *data, void(*give_up)(void *)) |
void * | iso_image_get_attached_data (IsoImage *image) |
IsoDir * | iso_image_get_root (const IsoImage *image) |
void | iso_image_set_volset_id (IsoImage *image, const char *volset_id) |
const char * | iso_image_get_volset_id (const IsoImage *image) |
void | iso_image_set_volume_id (IsoImage *image, const char *volume_id) |
const char * | iso_image_get_volume_id (const IsoImage *image) |
void | iso_image_set_publisher_id (IsoImage *image, const char *publisher_id) |
const char * | iso_image_get_publisher_id (const IsoImage *image) |
void | iso_image_set_data_preparer_id (IsoImage *image, const char *data_preparer_id) |
const char * | iso_image_get_data_preparer_id (const IsoImage *image) |
void | iso_image_set_system_id (IsoImage *image, const char *system_id) |
const char * | iso_image_get_system_id (const IsoImage *image) |
void | iso_image_set_application_id (IsoImage *image, const char *application_id) |
const char * | iso_image_get_application_id (const IsoImage *image) |
void | iso_image_set_copyright_file_id (IsoImage *image, const char *copyright_file_id) |
const char * | iso_image_get_copyright_file_id (const IsoImage *image) |
void | iso_image_set_abstract_file_id (IsoImage *image, const char *abstract_file_id) |
const char * | iso_image_get_abstract_file_id (const IsoImage *image) |
void | iso_image_set_biblio_file_id (IsoImage *image, const char *biblio_file_id) |
const char * | iso_image_get_biblio_file_id (const IsoImage *image) |
int | iso_image_set_pvd_times (IsoImage *image, char *creation_time, char *modification_time, char *expiration_time, char *effective_time) |
int | iso_image_get_pvd_times (IsoImage *image, char **creation_time, char **modification_time, char **expiration_time, char **effective_time) |
void | iso_image_set_app_use (IsoImage *image, const char *app_use_data, int count) |
int | iso_image_get_msg_id (IsoImage *image) |
int | iso_image_get_system_area (IsoImage *img, char system_area_data[32768], int *options, int flag) |
static int | dir_update_size (IsoImage *image, IsoDir *dir) |
int | iso_image_update_sizes (IsoImage *image) |
void | iso_image_set_ignore_aclea (IsoImage *image, int what) |
int | iso_image_get_ignore_aclea (IsoImage *image) |
static int | img_register_ino (IsoImage *image, IsoNode *node, int flag) |
int | img_collect_inos (IsoImage *image, IsoDir *dir, int flag) |
uint32_t | img_give_ino_number (IsoImage *image, int flag) |
static int | img_update_ino (IsoImage *image, IsoNode *node, int flag) |
int | img_make_inos (IsoImage *image, IsoDir *dir, int flag) |
int | iso_image_get_session_md5 (IsoImage *image, uint32_t *start_lba, uint32_t *end_lba, char md5[16], int flag) |
int | iso_image_set_checksums (IsoImage *image, char *checksum_array, uint32_t start_lba, uint32_t end_lba, uint32_t idx_count, int flag) |
int | iso_image_generator_is_running (IsoImage *image) |
int | iso_image_add_mips_boot_file (IsoImage *image, char *path, int flag) |
int | iso_image_get_mips_boot_files (IsoImage *image, char *paths[15], int flag) |
int | iso_image_give_up_mips_boot (IsoImage *image, int flag) |
static void | unset_blessing (IsoImage *img, unsigned int idx) |
int | iso_image_hfsplus_bless (IsoImage *img, enum IsoHfsplusBlessings blessing, IsoNode *node, int flag) |
int | iso_image_hfsplus_get_blessed (IsoImage *img, IsoNode ***blessed_nodes, int *bless_max, int flag) |
int | iso_image_set_sparc_core (IsoImage *img, IsoFile *sparc_core, int flag) |
int | iso_image_get_sparc_core (IsoImage *img, IsoFile **sparc_core, int flag) |
static int | hppa_palo_set_path (IsoImage *img, char *path, char **target, char *what, int flag) |
int | iso_image_set_hppa_palo (IsoImage *img, char *cmdline, char *bootloader, char *kernel_32, char *kernel_64, char *ramdisk, int flag) |
int | iso_image_get_hppa_palo (IsoImage *img, char **cmdline, char **bootloader, char **kernel_32, char **kernel_64, char **ramdisk) |
int | iso_image_set_alpha_boot (IsoImage *img, char *boot_loader_path, int flag) |
int | iso_image_get_alpha_boot (IsoImage *img, char **boot_loader_path) |
int | iso_image_set_truncate_mode (IsoImage *img, int mode, int length) |
int | iso_image_get_truncate_mode (IsoImage *img, int *mode, int *length) |
int | iso_image_truncate_name (IsoImage *image, const char *name, char **namept, int flag) |
int | iso_image_was_blind_attrs (IsoImage *image, int flag) |
static int | iso_dir_zisofs_discard_bpt (IsoDir *dir, int flag) |
int | iso_image_zisofs_discard_bpt (IsoImage *image, int flag) |
Definition at line 524 of file image.c.
References Iso_Dir::children, Iso_Image::id, ISO_CANCELED, ISO_DIR, ISO_FILE, iso_msg_submit(), iso_node_get_old_image_lba(), iso_stream_get_input_stream(), iso_stream_get_source_path(), iso_stream_update_size(), ISO_SUCCESS, iso_tree_get_node_path(), LIBISO_DIR, LIBISO_FILE, Iso_Node::next, and Iso_Node::type.
Referenced by iso_image_update_sizes().
|
static |
Definition at line 993 of file image.c.
References Iso_File::explicit_weight, Iso_File::from_old_session, Iso_Image::id, ISO_ALPHA_BOOT_NOTREG, ISO_BOOT_FILE_MISSING, iso_clone_mgtd_mem(), ISO_HPPA_PALO_NOTREG, iso_msg_submit(), iso_node_get_type(), ISO_OUT_OF_MEM, ISO_SUCCESS, iso_tree_path_to_node(), LIBISO_FILE, and Iso_File::sort_weight.
Referenced by iso_image_set_alpha_boot(), and iso_image_set_hppa_palo().
Definition at line 651 of file image.c.
References img_register_ino(), iso_dir_get_children(), iso_dir_iter_free(), iso_dir_iter_next(), iso_node_get_type(), ISO_OUT_OF_MEM, ISO_USED_INODE_RANGE, LIBISO_DIR, Iso_Image::root, and Iso_Image::used_inodes.
Referenced by img_give_ino_number().
uint32_t img_give_ino_number | ( | IsoImage * | image, |
int | flag | ||
) |
A global counter for Rock Ridge inode numbers in the ISO image filesystem.
On image import it gets maxed by the eventual inode numbers from PX entries. Up to the first 32 bit rollover it simply increments the counter. After the first rollover it uses a look ahead bitmap which gets filled by a full tree traversal. It covers the next inode numbers to come (somewhere between 1 and ISO_USED_INODE_RANGE which is quite many) and advances when being exhausted.
image | The image where the number shall be used |
flag | bit0= reset count (Caution: image must get new inos then) |
Definition at line 713 of file image.c.
References img_collect_inos(), Iso_Image::inode_counter, ISO_USED_INODE_RANGE, Iso_Image::used_inodes, and Iso_Image::used_inodes_start.
Referenced by create_boot_img_filesrc(), family_set_ino(), and iso_node_set_unique_id().
Definition at line 796 of file image.c.
References img_update_ino(), iso_dir_get_children(), iso_dir_iter_free(), iso_dir_iter_next(), iso_node_get_type(), and LIBISO_DIR.
Referenced by iso_image_import().
Definition at line 627 of file image.c.
References iso_node_get_id(), ISO_USED_INODE_RANGE, Iso_Image::used_inodes, and Iso_Image::used_inodes_start.
Referenced by img_collect_inos().
Definition at line 768 of file image.c.
References iso_node_get_id(), iso_node_get_type(), iso_node_set_unique_id(), LIBISO_DIR, and LIBISO_FILE.
Referenced by img_make_inos().
|
static |
Definition at line 1160 of file image.c.
References iso_dir_get_children(), iso_dir_iter_free(), iso_dir_iter_next(), iso_file_get_stream(), iso_node_get_type(), iso_stream_zisofs_discard_bpt(), ISO_SUCCESS, LIBISO_DIR, and LIBISO_FILE.
Referenced by iso_image_zisofs_discard_bpt().
int iso_image_add_mips_boot_file | ( | IsoImage * | image, |
char * | path, | ||
int | flag | ||
) |
Add a MIPS boot file path to the image. Up to 15 such files can be written into a MIPS Big Endian Volume Header if this is enabled by value 1 in iso_write_opts_set_system_area() option bits 2 to 7. A single file can be written into a DEC Boot Block if this is enabled by value 2 in iso_write_opts_set_system_area() option bits 2 to 7. So only the first added file gets into effect with this system area type. The data files which shall serve as MIPS boot files have to be brought into the image by the normal means.
image | The image to be manipulated. |
path | Absolute path of the boot file in the ISO 9660 Rock Ridge tree. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 862 of file image.c.
References ISO_BOOT_TOO_MANY_MIPS, ISO_OUT_OF_MEM, ISO_SUCCESS, Iso_Image::mips_boot_file_paths, and Iso_Image::num_mips_boot_files.
Referenced by Xorriso_add_mips_boot_file().
int iso_image_attach_data | ( | IsoImage * | image, |
void * | data, | ||
void(*)(void *) | give_up | ||
) |
Attach user defined data to the image. Use this if your application needs to store addition info together with the IsoImage. If the image already has data attached, the old data will be freed.
data | Pointer to application defined data that will be attached to the image. You can pass NULL to remove any already attached data. |
give_up | Function that will be called when the image does not need the data any more. It receives the data pointer as an argumente, and eventually causes data to be free. It can be NULL if you don't need it. |
Definition at line 304 of file image.c.
References ISO_NULL_POINTER, ISO_SUCCESS, Iso_Image::user_data, and Iso_Image::user_data_free.
Referenced by isoburn_read_image().
int iso_image_free_checksums | ( | IsoImage * | image, |
int | flag | ||
) |
Definition at line 279 of file image.c.
References Iso_Image::checksum_array, Iso_Image::checksum_end_lba, Iso_Image::checksum_idx_count, and Iso_Image::checksum_start_lba.
Referenced by iso_image_set_checksums(), and iso_image_unref().
int iso_image_generator_is_running | ( | IsoImage * | image | ) |
Inquire whether the image generator thread is still at work. As soon as the reply is 0, the caller of iso_image_create_burn_source() may assume that the image generation has ended. Nevertheless there may still be readily formatted output data pending in the burn_source or its consumers. So the final delivery of the image has also to be checked at the data consumer side,e.g. by burn_drive_get_status() in case of libburn as consumer.
image | The image to inquire. |
Definition at line 855 of file image.c.
References Iso_Image::generator_is_running.
Referenced by Xorriso_pacifier_loop().
const char* iso_image_get_abstract_file_id | ( | const IsoImage * | image | ) |
Get the abstract information of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 439 of file image.c.
References Iso_Image::abstract_file_id.
Referenced by Xorriso_aquire_drive().
int iso_image_get_alpha_boot | ( | IsoImage * | img, |
char ** | boot_loader_path | ||
) |
Inquire the path submitted by iso_image_set_alpha_boot() Do not free() the returned pointer.
img | The image to be inquired. |
boot_loader_path | Will return the path. NULL if none is currently submitted. |
Definition at line 1092 of file image.c.
References Iso_Image::alpha_boot_image, and ISO_SUCCESS.
Referenced by Xorriso_boot_status_non_mbr().
const char* iso_image_get_application_id | ( | const IsoImage * | image | ) |
Get the application id of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 411 of file image.c.
References Iso_Image::application_id.
Referenced by Xorriso_aquire_drive().
void* iso_image_get_attached_data | ( | IsoImage * | image | ) |
The the data previously attached with iso_image_attach_data()
Definition at line 329 of file image.c.
References Iso_Image::user_data.
Referenced by Xorriso__read_pacifier().
const char* iso_image_get_biblio_file_id | ( | const IsoImage * | image | ) |
Get the biblio information of a image. The returned string is owned by the image and must not be freed or changed.
Definition at line 452 of file image.c.
References Iso_Image::biblio_file_id.
Referenced by Xorriso_aquire_drive().
const char* iso_image_get_copyright_file_id | ( | const IsoImage * | image | ) |
Get the copyright information of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 425 of file image.c.
References Iso_Image::copyright_file_id.
Referenced by Xorriso_aquire_drive().
const char* iso_image_get_data_preparer_id | ( | const IsoImage * | image | ) |
Get the data preparer of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 385 of file image.c.
References Iso_Image::data_preparer_id.
Referenced by Xorriso_pvd_info(), and Xorriso_write_session().
int iso_image_get_hppa_palo | ( | IsoImage * | img, |
char ** | cmdline, | ||
char ** | bootloader, | ||
char ** | kernel_32, | ||
char ** | kernel_64, | ||
char ** | ramdisk | ||
) |
Inquire the current settings of iso_image_set_hppa_palo(). Do not free() the returned pointers.
img | The image to be inquired. |
cmdline | Will return the command line. |
bootloader | Will return the absolute path of the bootloader file. |
kernel_32 | Will return the absolute path of the 32 bit kernel file. |
kernel_64 | Will return the absolute path of the 64 bit kernel file. |
ramdisk | Will return the absolute path of the RAM disk file. |
Definition at line 1066 of file image.c.
References Iso_Image::hppa_bootloader, Iso_Image::hppa_cmdline, Iso_Image::hppa_kernel_32, Iso_Image::hppa_kernel_64, Iso_Image::hppa_ramdisk, and ISO_SUCCESS.
Referenced by Xorriso_boot_status_non_mbr().
int iso_image_get_ignore_aclea | ( | IsoImage * | image | ) |
Obtain the current setting of iso_image_set_ignore_aclea().
image | The image to be inquired |
Definition at line 618 of file image.c.
References Iso_Image::builder_ignore_acl, Iso_Image::builder_ignore_ea, and Iso_Image::builder_take_all_ea.
Referenced by isoburn_read_image().
int iso_image_get_mips_boot_files | ( | IsoImage * | image, |
char * | paths[15], | ||
int | flag | ||
) |
Obtain the number of added MIPS Big Endian boot files and pointers to their paths in the ISO 9660 Rock Ridge tree.
image | The image to be inquired. |
paths | An array of pointers to be set to the registered boot file paths. This are just pointers to data inside IsoImage. Do not free() them. Eventually make own copies of the data before manipulating the image. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 874 of file image.c.
References Iso_Image::mips_boot_file_paths, and Iso_Image::num_mips_boot_files.
Referenced by Xorriso_add_mips_boot_file(), and Xorriso_boot_status_non_mbr().
int iso_image_get_msg_id | ( | IsoImage * | image | ) |
Get the id of an IsoImage, used for message reporting. This message id, retrieved with iso_obtain_msgs(), can be used to distinguish what IsoImage has issued a given message.
Definition at line 508 of file image.c.
References Iso_Image::id.
const char* iso_image_get_publisher_id | ( | const IsoImage * | image | ) |
Get the publisher of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 371 of file image.c.
References Iso_Image::publisher_id.
Referenced by Xorriso_aquire_drive().
int iso_image_get_pvd_times | ( | IsoImage * | image, |
char ** | creation_time, | ||
char ** | modification_time, | ||
char ** | expiration_time, | ||
char ** | effective_time | ||
) |
Get the four timestamps from the Primary Volume Descriptor of the imported ISO image. The timestamps are strings which are either empty or consist of 16 digits of the form YYYYMMDDhhmmsscc, plus a signed byte in the range of -48 to +52, which gives the timezone offset in steps of 15 minutes. None of the returned string pointers shall be used for altering or freeing data. They are just for reading.
image | The image to be inquired. |
creation_time | Returns a pointer to the Volume Creation time: When "the information in the volume was created." |
modification_time | Returns a pointer to Volume Modification time: When "the information in the volume was last modified." |
expiration_time | Returns a pointer to Volume Expiration time: When "the information in the volume may be regarded as obsolete." |
effective_time | Returns a pointer to Volume Expiration time: When "the information in the volume may be used." |
Definition at line 481 of file image.c.
References Iso_Image::creation_time, Iso_Image::effective_time, Iso_Image::expiration_time, ISO_NULL_POINTER, ISO_SUCCESS, and Iso_Image::modification_time.
Referenced by Xorriso_pvd_info(), and Xorriso_scan_report_lines().
Get the root directory of the image. No extra ref is added to it, so you must not unref it. Use iso_node_ref() if you want to get your own reference.
Definition at line 334 of file image.c.
References Iso_Image::root.
Referenced by isoburn_root_defaults(), Xorriso_expand_pattern(), Xorriso_graft_in(), Xorriso_grasp_loaded_aaip(), Xorriso_make_iso_write_opts(), and Xorriso_rmi().
int iso_image_get_session_md5 | ( | IsoImage * | image, |
uint32_t * | start_lba, | ||
uint32_t * | end_lba, | ||
char | md5[16], | ||
int | flag | ||
) |
Obtain the recorded MD5 checksum of the session which was loaded as ISO image. Such a checksum may be stored together with others in a contiguous array at the end of the session. The session checksum covers the data blocks from address start_lba to address end_lba - 1. It does not cover the recorded array of md5 checksums. Layout, size, and position of the checksum array is recorded in the xattr "isofs.ca" of the session root node.
image | The image to inquire |
start_lba | Returns the first block address covered by md5 |
end_lba | Returns the first block address not covered by md5 any more |
md5 | Returns 16 byte of MD5 checksum |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 832 of file image.c.
References Iso_Image::checksum_array, Iso_Image::checksum_end_lba, Iso_Image::checksum_idx_count, Iso_Image::checksum_start_lba, and ISO_SUCCESS.
Referenced by Xorriso_check_session_md5(), and Xorriso_image_has_md5().
Obtain the current setting of iso_image_set_sparc_core().
img | The image to be inquired. |
sparc_core | Will return a pointer to the IsoFile (or NULL, which is not an error) |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 982 of file image.c.
References Iso_Image::sparc_core_node.
int iso_image_get_system_area | ( | IsoImage * | img, |
char | data[32768], | ||
int * | options, | ||
int | flag | ||
) |
Obtain a copy of the eventually loaded first 32768 bytes of the imported session, the System Area. It will be written to the start of the next session unless it gets overwritten by iso_write_opts_set_system_area().
img | The image to be inquired. |
data | A byte array of at least 32768 bytes to take the loaded bytes. |
options | The option bits which will be applied if not overridden by iso_write_opts_set_system_area(). See there. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 513 of file image.c.
References Iso_Image::system_area_data, and Iso_Image::system_area_options.
Referenced by Xorriso_set_system_area().
const char* iso_image_get_system_id | ( | const IsoImage * | image | ) |
Get the system id of a image. The returned string is owned by the image and must not be freed nor changed.
Definition at line 398 of file image.c.
References Iso_Image::system_id.
Referenced by Xorriso_aquire_drive().
int iso_image_get_truncate_mode | ( | IsoImage * | img, |
int * | mode, | ||
int * | length | ||
) |
Inquire the current setting of iso_image_set_truncate_mode().
img | The image which shall be inquired. |
mode | Returns the mode value. |
length | Returns the length value. |
Definition at line 1112 of file image.c.
References ISO_SUCCESS, Iso_Image::truncate_length, and Iso_Image::truncate_mode.
Referenced by Xorriso_aquire_drive().
const char* iso_image_get_volset_id | ( | const IsoImage * | image | ) |
Get the volset identifier. The returned string is owned by the image and must not be freed nor changed.
Definition at line 345 of file image.c.
References Iso_Image::volset_id.
Referenced by Xorriso_aquire_drive().
const char* iso_image_get_volume_id | ( | const IsoImage * | image | ) |
Get the volume identifier. The returned string is owned by the image and must not be freed nor changed.
Definition at line 358 of file image.c.
References Iso_Image::volume_id.
Referenced by Xorriso_get_volid(), Xorriso_pvd_info(), Xorriso_scan_report_lines(), and Xorriso_set_volid().
int iso_image_give_up_mips_boot | ( | IsoImage * | image, |
int | flag | ||
) |
Clear the list of MIPS Big Endian boot file paths.
image | The image to be manipulated. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 886 of file image.c.
References ISO_SUCCESS, Iso_Image::mips_boot_file_paths, and Iso_Image::num_mips_boot_files.
Referenced by iso_image_unref(), and Xorriso_add_mips_boot_file().
int iso_image_hfsplus_bless | ( | IsoImage * | img, |
enum IsoHfsplusBlessings | blessing, | ||
IsoNode * | node, | ||
int | flag | ||
) |
Issue a blessing to a particular IsoNode. If the blessing is already issued to some file, then it gets revoked from that one.
img | The image to manipulate. |
blessing | The kind of blessing to be issued. |
node | The file that shall be blessed. It must actually be an IsoDir or IsoFile as is appropriate for the kind of blessing. (See above enum.) The node may not yet bear a blessing other than the desired one. If node is NULL, then the blessing will be revoked from any node which bears it. |
flag | Bitfield for control purposes. bit0= Revoke blessing if node != NULL bears it. bit1= Revoke any blessing of the node, regardless of parameter blessing. If node is NULL, then revoke all blessings in the image. |
Definition at line 907 of file image.c.
References Iso_Image::hfsplus_blessed, ISO_HFSPLUS_BLESS_INTEL_BOOTFILE, ISO_HFSPLUS_BLESS_MAX, iso_node_ref(), ISO_WRONG_ARG_VALUE, LIBISO_DIR, LIBISO_FILE, Iso_Node::type, and unset_blessing().
Referenced by Xorriso_hfsplus_bless().
int iso_image_hfsplus_get_blessed | ( | IsoImage * | img, |
IsoNode *** | blessed_nodes, | ||
int * | bless_max, | ||
int | flag | ||
) |
Get the array of nodes which are currently blessed. Array indice correspond to enum IsoHfsplusBlessings. Array element value NULL means that no node bears that blessing.
Several usage restrictions apply. See parameter blessed_nodes.
img | The image to inquire. |
blessed_nodes | Will return a pointer to an internal node array of image. This pointer is valid only as long as image exists and only until iso_image_hfsplus_bless() gets used to manipulate the blessings. Do not free() this array. Do not alter the content of the array directly, but rather use iso_image_hfsplus_bless() and re-inquire by iso_image_hfsplus_get_blessed(). This call does not impose an extra reference on the nodes in the array. So do not iso_node_unref() them. Nodes listed here are not necessarily grafted into the tree of the IsoImage. |
bless_max | Will return the number of elements in the array. It is unlikely but not outruled that it will be larger than ISO_HFSPLUS_BLESS_MAX in this libisofs.h file. |
flag | Bitfield for control purposes. Submit 0. |
Definition at line 960 of file image.c.
References Iso_Image::hfsplus_blessed, and ISO_HFSPLUS_BLESS_MAX.
Referenced by Xorriso_get_blessing(), and Xorriso_hfsplus_bless().
int iso_image_new | ( | const char * | name, |
IsoImage ** | image | ||
) |
Create a new image, empty.
The image will be owned by you and should be unref() when no more needed.
name | Name of the image. This will be used as volset_id and volume_id. |
image | Location where the image pointer will be stored. |
Definition at line 131 of file image.c.
References Iso_Image::alpha_boot_image, Iso_Image::application_use, Iso_Image::blind_on_local_get_attrs, Iso_Image::builder, Iso_Image::builder_ignore_acl, Iso_Image::builder_ignore_ea, Iso_Image::checksum_array, Iso_Image::checksum_end_lba, Iso_Image::checksum_idx_count, Iso_Image::checksum_start_lba, Iso_Image::collision_warnings, Iso_Image::fs, Iso_Image::generator_is_running, Iso_Image::hfsplus_blessed, Iso_Image::hppa_bootloader, Iso_Image::hppa_cmdline, Iso_Image::hppa_kernel_32, Iso_Image::hppa_kernel_64, Iso_Image::hppa_ramdisk, Iso_Image::id, Iso_Image::import_src, Iso_Image::imported_sa_info, Iso_Image::inode_counter, iso_filesystem_unref(), ISO_HFSPLUS_BLESS_MAX, iso_local_filesystem_new(), iso_message_id, iso_node_basic_builder_new(), iso_node_builder_unref(), iso_node_new_root(), ISO_NULL_POINTER, ISO_OUT_OF_MEM, ISO_SUCCESS, LIBISOFS_NODE_NAME_MAX, Iso_Image::mips_boot_file_paths, Iso_Image::num_mips_boot_files, Iso_Image::refcount, Iso_Image::root, Iso_Image::sparc_core_node, Iso_Image::system_area_data, Iso_Image::system_area_options, Iso_Image::truncate_buffer, Iso_Image::truncate_length, Iso_Image::truncate_mode, Iso_Image::used_inodes, Iso_Image::used_inodes_start, Iso_Image::volset_id, and Iso_Image::volume_id.
Referenced by isoburn_new(), and isoburn_read_image().
void iso_image_ref | ( | IsoImage * | image | ) |
Increments the reference counting of the given image.
Definition at line 215 of file image.c.
References Iso_Image::refcount.
Referenced by ecma119_image_new(), isoburn_get_attached_image(), isoburn_read_image(), and Xorriso_aquire_drive().
void iso_image_set_abstract_file_id | ( | IsoImage * | image, |
const char * | abstract_file_id | ||
) |
Fill abstract information for the image. Usually this refers to a file on disc. Up to 37 characters.
Definition at line 432 of file image.c.
References Iso_Image::abstract_file_id.
Referenced by iso_image_import(), and Xorriso_write_session().
int iso_image_set_alpha_boot | ( | IsoImage * | img, |
char * | boot_loader_path, | ||
int | flag | ||
) |
Submit the path of the DEC Alpha Secondary Bootstrap Loader file. The path must lead to an already existing data file in the ISO image which stays with this path until image production. This setting has an effect only if system area type is set to 6 with iso_write_opts_set_system_area().
img | The image to be manipulated. |
boot_loader_path | Absolute path of a data file in the ISO image. Submit NULL to free this image property. |
flag | Bitfield for control purposes. Unused yet. Submit 0. |
Definition at line 1079 of file image.c.
References Iso_Image::alpha_boot_image, hppa_palo_set_path(), and ISO_SUCCESS.
Referenced by Xorriso_set_alpha_boot().
void iso_image_set_app_use | ( | IsoImage * | image, |
const char * | app_use_data, | ||
int | count | ||
) |
Fill Application Use field of the Primary Volume Descriptor. ECMA-119 8.4.32 Application Use (BP 884 to 1395) "This field shall be reserved for application use. Its content is not specified by this Standard."
image | The image to manipulate. |
app_use_data | Up to 512 bytes of data. |
count | The number of bytes in app_use_data. If the number is smaller than 512, then the remaining bytes will be set to 0. |
Definition at line 495 of file image.c.
References Iso_Image::application_use.
Referenced by Xorriso_write_application_use().
void iso_image_set_application_id | ( | IsoImage * | image, |
const char * | application_id | ||
) |
Fill in the application id for a image. Up to 128 chars.
Definition at line 405 of file image.c.
References Iso_Image::application_id.
Referenced by iso_image_import(), and Xorriso_write_session().
void iso_image_set_biblio_file_id | ( | IsoImage * | image, |
const char * | biblio_file_id | ||
) |
Fill biblio information for the image. Usually this refers to a file on disc. Up to 37 characters.
Definition at line 446 of file image.c.
References Iso_Image::biblio_file_id.
Referenced by iso_image_import(), and Xorriso_write_session().
int iso_image_set_checksums | ( | IsoImage * | image, |
char * | checksum_array, | ||
uint32_t | start_lba, | ||
uint32_t | end_lba, | ||
uint32_t | idx_count, | ||
int | flag | ||
) |
Definition at line 843 of file image.c.
References Iso_Image::checksum_array, Iso_Image::checksum_end_lba, Iso_Image::checksum_idx_count, Iso_Image::checksum_start_lba, and iso_image_free_checksums().
Referenced by transplant_checksum_buffer().
void iso_image_set_copyright_file_id | ( | IsoImage * | image, |
const char * | copyright_file_id | ||
) |
Fill copyright information for the image. Usually this refers to a file on disc. Up to 37 characters.
Definition at line 418 of file image.c.
References Iso_Image::copyright_file_id.
Referenced by iso_image_import(), and Xorriso_write_session().
void iso_image_set_data_preparer_id | ( | IsoImage * | image, |
const char * | data_preparer_id | ||
) |
Fill in the data preparer for a image.
Definition at line 378 of file image.c.
References Iso_Image::data_preparer_id.
Referenced by iso_image_import(), and Xorriso_write_session().
int iso_image_set_hppa_palo | ( | IsoImage * | img, |
char * | cmdline, | ||
char * | bootloader, | ||
char * | kernel_32, | ||
char * | kernel_64, | ||
char * | ramdisk, | ||
int | flag | ||
) |
Define a command line and submit the paths of four mandatory files for production of a HP-PA PALO boot sector for PA-RISC machines. The paths must lead to already existing data files in the ISO image which stay with these paths until image production.
img | The image to be manipulated. |
cmdline | Up to 127 characters of command line. |
bootloader | Absolute path of a data file in the ISO image. |
kernel_32 | Absolute path of a data file in the ISO image which serves as 32 bit kernel. |
kernel_64 | Absolute path of a data file in the ISO image which serves as 64 bit kernel. |
ramdisk | Absolute path of a data file in the ISO image. |
flag | Bitfield for control purposes bit0= Let NULL parameters free the corresponding image properties. Else only the non-NULL parameters of this call have an effect |
Definition at line 1035 of file image.c.
References Iso_Image::hppa_bootloader, Iso_Image::hppa_cmdline, Iso_Image::hppa_kernel_32, Iso_Image::hppa_kernel_64, hppa_palo_set_path(), Iso_Image::hppa_ramdisk, iso_clone_mgtd_mem(), ISO_OUT_OF_MEM, and ISO_SUCCESS.
Referenced by iso_image_unref(), and Xorriso_set_hppa_boot_parm().
void iso_image_set_ignore_aclea | ( | IsoImage * | image, |
int | what | ||
) |
Control whether ACL and xattr will be imported from external filesystems (typically the local POSIX filesystem) when new nodes get inserted. If enabled by iso_write_opts_set_aaip() they will later be written into the image as AAIP extension fields.
A change of this setting does neither affect existing IsoNode objects nor the way how ACL and xattr are handled when loading an ISO image. The latter is controlled by iso_read_opts_set_no_aaip().
image | The image of which the behavior is to be controlled |
what | A bit field which sets the behavior: bit0= ignore ACLs if the external file object bears some bit1= ignore xattr if the external file object bears some bit3= if not bit1: import all xattr namespaces, not only "user." |
Definition at line 610 of file image.c.
References Iso_Image::builder_ignore_acl, Iso_Image::builder_ignore_ea, and Iso_Image::builder_take_all_ea.
Referenced by isoburn_read_image(), isoburn_welcome_media(), and Xorriso_set_ignore_aclea().
void iso_image_set_publisher_id | ( | IsoImage * | image, |
const char * | publisher_id | ||
) |
Fill in the publisher for a image.
Definition at line 365 of file image.c.
References Iso_Image::publisher_id.
Referenced by iso_image_import(), and Xorriso_write_session().
int iso_image_set_pvd_times | ( | IsoImage * | image, |
char * | creation_time, | ||
char * | modification_time, | ||
char * | expiration_time, | ||
char * | effective_time | ||
) |
Definition at line 459 of file image.c.
References Iso_Image::creation_time, Iso_Image::effective_time, Iso_Image::expiration_time, ISO_NULL_POINTER, ISO_OUT_OF_MEM, ISO_SUCCESS, and Iso_Image::modification_time.
Referenced by iso_image_import().
Designate a data file in the ISO image of which the position and size shall be written after the SUN Disk Label. The position is written as 64-bit big-endian number to byte position 0x228. The size is written as 32-bit big-endian to 0x230. This setting has an effect only if system area type is set to 3 with iso_write_opts_set_system_area().
img | The image to be manipulated. |
sparc_core | The IsoFile which shall be mentioned after the SUN Disk label. NULL is a permissible value. It disables this feature. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 970 of file image.c.
References iso_node_ref(), iso_node_unref(), and Iso_Image::sparc_core_node.
Referenced by Xorriso_set_system_area().
void iso_image_set_system_id | ( | IsoImage * | image, |
const char * | system_id | ||
) |
Fill in the system id for a image. Up to 32 characters.
Definition at line 392 of file image.c.
References Iso_Image::system_id.
Referenced by iso_image_import(), and Xorriso_write_session().
int iso_image_set_truncate_mode | ( | IsoImage * | img, |
int | mode, | ||
int | length | ||
) |
Set the name truncation mode and the maximum name length for nodes from image importing, creation of new IsoNode objects, and name changing image manipulations.
Truncated names are supposed to be nearly unique because they end by the MD5 of the first 4095 characters of the untruncated name. One should treat them as if they were the untruncated original names.
For proper processing of truncated names it is necessary to use iso_image_set_node_name() instead of iso_node_set_name() iso_image_add_new_dir() iso_tree_add_new_dir() iso_image_add_new_file() iso_tree_add_new_file() iso_image_add_new_special() iso_tree_add_new_special() iso_image_add_new_symlink() iso_tree_add_new_symlink() iso_image_tree_clone() iso_tree_clone() iso_image_dir_get_node() iso_dir_get_node() iso_image_path_to_node() iso_tree_path_to_node()
Beware of ambiguities if both, the full name and the truncated name, exist in the same directory. Best is to only set truncation parameters once with an ISO filesystem and to never change them later.
If writing of AAIP is enabled, then the mode and length are recorded in xattr "isofs.nt" of the root node. If reading of AAIP is enabled and "isofs.nt" is found, then it gets into effect if both, the truncate mode value from "isofs.nt" and the current truncate mode of the IsoImage are 1, and the length is between 64 and 255.
img | The image which shall be manipulated. |
mode | 0= Do not truncate but throw error ISO_RR_NAME_TOO_LONG if a file name is longer than parameter length. 1= Truncate to length and overwrite the last 33 bytes of that length by a colon ':' and the hex representation of the MD5 of the first 4095 bytes of the whole oversized name. Potential incomplete UTF-8 characters will get their leading bytes replaced by '_'. Mode 1 is the default. |
length | Maximum byte count of a file name. Permissible values are 64 to 255. Default is 255. |
Definition at line 1100 of file image.c.
References ISO_SUCCESS, ISO_WRONG_ARG_VALUE, LIBISOFS_NODE_NAME_MAX, Iso_Image::truncate_length, and Iso_Image::truncate_mode.
Referenced by isoburn_read_image(), Xorriso_aquire_drive(), and Xorriso_set_file_name_limit().
void iso_image_set_volset_id | ( | IsoImage * | image, |
const char * | volset_id | ||
) |
Fill in the volset identifier for a image.
Definition at line 339 of file image.c.
References Iso_Image::volset_id.
Referenced by iso_image_import(), and Xorriso_write_session().
void iso_image_set_volume_id | ( | IsoImage * | image, |
const char * | volume_id | ||
) |
Fill in the volume identifier for a image.
Definition at line 352 of file image.c.
References Iso_Image::volume_id.
Referenced by iso_image_import(), and Xorriso_set_volid().
int iso_image_truncate_name | ( | IsoImage * | image, |
const char * | name, | ||
char ** | namept, | ||
int | flag | ||
) |
Definition at line 1120 of file image.c.
References ISO_NULL_POINTER, ISO_SUCCESS, iso_truncate_rr_name(), Iso_Image::truncate_buffer, Iso_Image::truncate_length, and Iso_Image::truncate_mode.
Referenced by iso_image_add_new_dir(), iso_image_add_new_file(), iso_image_add_new_special(), iso_image_add_new_symlink(), iso_tree_add_new_cut_out_node(), iso_tree_add_new_node(), and iso_tree_add_node_builder().
void iso_image_unref | ( | IsoImage * | image | ) |
Decrements the reference counting of the given image. If it reaches 0, the image is free, together with its tree nodes (whether their refcount reach 0 too, of course).
Definition at line 225 of file image.c.
References Iso_Image::abstract_file_id, Iso_Image::alpha_boot_image, Iso_Image::application_id, Iso_Image::biblio_file_id, Iso_Image::bootcat, Iso_Image::builder, Iso_Image::copyright_file_id, Iso_Image::creation_time, Iso_Image::data_preparer_id, Iso_Image::effective_time, el_torito_boot_catalog_free(), Iso_Image::excludes, Iso_Image::expiration_time, Iso_Image::fs, Iso_Image::hfsplus_blessed, Iso_Image::import_src, Iso_Image::imported_sa_info, iso_data_source_unref(), iso_filesystem_unref(), ISO_HFSPLUS_BLESS_MAX, iso_image_free_checksums(), iso_image_give_up_mips_boot(), iso_image_set_hppa_palo(), iso_imported_sa_unref(), iso_node_builder_unref(), iso_node_unref(), Iso_Image::modification_time, Iso_Image::nexcludes, Iso_Image::publisher_id, Iso_Image::refcount, Iso_Image::root, Iso_Image::sparc_core_node, Iso_Image::system_area_data, Iso_Image::system_id, Iso_Image::used_inodes, Iso_Image::user_data, Iso_Image::user_data_free, Iso_Image::volset_id, and Iso_Image::volume_id.
Referenced by ecma119_image_free(), isoburn_attach_image(), isoburn_destroy(), isoburn_read_image(), Xorriso_aquire_drive(), Xorriso_attach_boot_image(), Xorriso_boot_image_status(), Xorriso_create_empty_iso(), Xorriso_detach_libraries(), Xorriso_give_up_drive(), Xorriso_pacifier_loop(), Xorriso_record_boot_info(), Xorriso_set_system_area_path(), Xorriso_show_boot_info(), and Xorriso_write_session().
int iso_image_update_sizes | ( | IsoImage * | image | ) |
Update the sizes of all files added to image.
This may be called just before iso_image_create_burn_source() to force libisofs to check the file sizes again (they're already checked when added to IsoImage). It is useful if you have changed some files after adding then to the image.
Definition at line 600 of file image.c.
References dir_update_size(), ISO_NULL_POINTER, and Iso_Image::root.
Referenced by Xorriso_write_session().
int iso_image_was_blind_attrs | ( | IsoImage * | image, |
int | flag | ||
) |
Inquire whether some local filesystem xattr namespace could not be explored during node building.This may happen due to lack of administrator privileges e.g. on FreeBSD namespace "system". It may well be that the processed local files have no attributes which would require special privileges. But already their existence was neither denied nor confirmed.
image | The image to inquire. |
flag | Bitfield for control purposes: bit0 = reset internal value to 0 |
Definition at line 1143 of file image.c.
References Iso_Image::blind_on_local_get_attrs, and ISO_NULL_POINTER.
Referenced by Xorriso_write_session().
int iso_image_zisofs_discard_bpt | ( | IsoImage * | image, |
int | flag | ||
) |
Discard all buffered zisofs compression block pointers of streams in the given image, which are zisofs compression streams and not currently opened.
image | The image to be manipulated. |
flag | Bitfield for control purposes, unused yet, submit 0 |
Definition at line 1199 of file image.c.
References iso_dir_zisofs_discard_bpt(), ISO_NULL_POINTER, ISO_SUCCESS, and Iso_Image::root.
Referenced by Xorriso_set_filter().
int iso_imported_sa_new | ( | struct iso_imported_sys_area ** | boots, |
int | flag | ||
) |
Definition at line 26 of file image.c.
References iso_imported_sys_area::alpha_boot_image, iso_imported_sys_area::apm_req, iso_imported_sys_area::gpt_backup_comments, iso_imported_sys_area::gpt_req, iso_imported_sys_area::hppa_bootloader, iso_imported_sys_area::hppa_cmdline, iso_imported_sys_area::hppa_kernel_32, iso_imported_sys_area::hppa_kernel_64, iso_imported_sys_area::hppa_ramdisk, ISO_OUT_OF_MEM, iso_imported_sys_area::mbr_req, iso_imported_sys_area::mips_boot_file_paths, iso_imported_sys_area::mips_vd_entries, iso_imported_sys_area::sparc_core_node, iso_imported_sys_area::sparc_disc_label, and iso_imported_sys_area::sparc_entries.
Referenced by iso_analyze_system_area().
int iso_imported_sa_unref | ( | struct iso_imported_sys_area ** | boots, |
int | flag | ||
) |
Definition at line 60 of file image.c.
References iso_imported_sys_area::alpha_boot_image, iso_imported_sys_area::apm_req, iso_imported_sys_area::apm_req_count, iso_imported_sys_area::gpt_backup_comments, iso_imported_sys_area::gpt_req, iso_imported_sys_area::gpt_req_count, iso_imported_sys_area::hppa_bootloader, iso_imported_sys_area::hppa_cmdline, iso_imported_sys_area::hppa_kernel_32, iso_imported_sys_area::hppa_kernel_64, iso_imported_sys_area::hppa_ramdisk, iso_node_unref(), LIBISO_FREE_MEM, iso_imported_sys_area::mbr_req, iso_imported_sys_area::mbr_req_count, iso_imported_sys_area::mips_boot_file_paths, iso_imported_sys_area::mips_vd_entries, iso_imported_sys_area::mipsel_boot_file_path, iso_imported_sys_area::num_mips_boot_files, iso_imported_sys_area::refcount, iso_imported_sys_area::sparc_core_node, iso_imported_sys_area::sparc_disc_label, and iso_imported_sys_area::sparc_entries.
Referenced by iso_analyze_system_area(), and iso_image_unref().
|
static |
Definition at line 899 of file image.c.
References Iso_Image::hfsplus_blessed, and iso_node_unref().
Referenced by iso_image_hfsplus_bless().