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

isofs_wrap.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <libburn/libburn.h>
#include <libisofs/libisofs.h>
#include "libisoburn.h"
#include "isoburn.h"
Include dependency graph for isofs_wrap.c:

Go to the source code of this file.

Data Structures

struct  ecma119_pri_vol_desc
 

Macros

#define BP(a, b)   [(b) - (a) + 1]
 

Functions

static uint32_t iso_read_lsb (const uint8_t *buf, int bytes)
 
IsoImageisoburn_get_attached_image (struct burn_drive *d)
 
int isoburn_get_attached_start_lba (struct burn_drive *d)
 
static void isoburn_idle_free_function (void *ignored)
 
int isoburn_root_defaults (IsoImage *image, int flag)
 
int isoburn_read_image (struct burn_drive *d, struct isoburn_read_opts *read_opts, IsoImage **image)
 
int isoburn_attach_image (struct burn_drive *d, IsoImage *image)
 
int isoburn_attach_start_lba (struct burn_drive *d, int lba, int flag)
 
int isoburn_activate_session (struct burn_drive *drive)
 
int isoburn_get_img_partition_offset (struct burn_drive *drive, uint32_t *block_offset_2k)
 
static int isoburn_inspect_partition (struct isoburn *o, uint32_t img_size, int flag)
 
int isoburn_start_emulation (struct isoburn *o, int flag)
 
int isoburn_invalidate_iso (struct isoburn *o, int flag)
 
int isoburn_set_read_pacifier (struct burn_drive *drive, int(*read_pacifier)(IsoImage *, IsoFileSource *), void *read_handle)
 

Macro Definition Documentation

◆ BP

#define BP (   a,
 
)    [(b) - (a) + 1]

Definition at line 38 of file isofs_wrap.c.

Function Documentation

◆ iso_read_lsb()

◆ isoburn_activate_session()

int isoburn_activate_session ( struct burn_drive d)

Call this after isoburn_disc_write has finished and burn_drive_wrote_well() indicates success. It will eventually complete the emulation of multi-session functionality, if needed at all. Let libisoburn decide. Not a wrapper, but peculiar to libisoburn.

Since
0.1.0
Parameters
dThe output drive to which the session was written
Returns
1 success , <=0 failure

Definition at line 393 of file isofs_wrap.c.

References BURN_DISC_APPENDABLE, BURN_DISC_BLANK, burn_drive_get_drive_role(), burn_random_access_write(), isoburn::do_fsync, isoburn::drive, isoburn::emulation_mode, isoburn::fabricated_disc_status, isoburn::fabricated_msc2, isoburn_find_emulator(), isoburn::target_iso_head, isoburn::target_iso_head_size, and isoburn::zero_nwa.

Referenced by isoburn_invalidate_iso(), and Xorriso_write_session().

◆ isoburn_attach_image()

int isoburn_attach_image ( struct burn_drive d,
IsoImage image 
)

Set the IsoImage to be used with a drive. This eventually releases the reference to the old IsoImage attached to the drive. Caution: Use with care. It hardly makes sense to replace an image that reflects a valid ISO image on the medium. This call is rather intended for writing a newly created and populated image to blank media. The use case in xorriso is to let an image survive the change or demise of the outdev target drive.

Since
0.1.0
Parameters
dThe drive which shall be write target of the volset.
imageThe image that represents the image to be written. This image pointer MUST already be a valid reference suitable for iso_image_unref(). It may have been obtained by appropriate libisofs calls or by isoburn_read_image() with d==NULL.
Returns
<=0 error , 1 = success

Definition at line 351 of file isofs_wrap.c.

References isoburn::image, isoburn::image_start_lba, iso_image_unref(), isoburn_find_emulator(), and isoburn_msgs_submit().

Referenced by Xorriso_aquire_drive().

◆ isoburn_attach_start_lba()

int isoburn_attach_start_lba ( struct burn_drive d,
int  lba,
int  flag 
)

Set the start address of the image that is attached to the drive, if any.

Since
1.2.2
Parameters
dThe drive to inquire
lbaThe logical block address where the System Area of the image starts. <0 means that the address is invalid.
flagBitfield, submit 0 for now.
Returns
<=0 error (e.g. because no image is attached), 1 = success

Definition at line 374 of file isofs_wrap.c.

References isoburn::image, isoburn::image_start_lba, and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive().

◆ isoburn_get_attached_image()

IsoImage* isoburn_get_attached_image ( struct burn_drive d)

Get the image attached to a drive, if any.

Since
0.1.0
Parameters
dThe drive to inquire
Returns
A reference to attached image, or NULL if the drive has no image attached. This reference needs to be released via iso_image_unref() when it is not longer needed.

Definition at line 92 of file isofs_wrap.c.

References isoburn::image, iso_image_ref(), and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive(), Xorriso_attach_boot_image(), Xorriso_boot_image_status(), Xorriso_pacifier_loop(), Xorriso_record_boot_info(), Xorriso_set_system_area_path(), Xorriso_show_boot_info(), and Xorriso_write_session().

◆ isoburn_get_attached_start_lba()

int isoburn_get_attached_start_lba ( struct burn_drive d)

Get the start address of the image that is attached to the drive, if any.

Since
1.2.2
Parameters
dThe drive to inquire
Returns
The logical block address where the System Area of the image starts. <0 means that the address is invalid.

Definition at line 109 of file isofs_wrap.c.

References isoburn::image, isoburn::image_start_lba, and isoburn_find_emulator().

Referenced by Xorriso_aquire_drive(), and Xorriso_check_media().

◆ isoburn_get_img_partition_offset()

int isoburn_get_img_partition_offset ( struct burn_drive drive,
uint32_t *  block_offset_2k 
)

◆ isoburn_idle_free_function()

static void isoburn_idle_free_function ( void *  ignored)
static

Definition at line 123 of file isofs_wrap.c.

Referenced by isoburn_read_image().

◆ isoburn_inspect_partition()

◆ isoburn_invalidate_iso()

int isoburn_invalidate_iso ( struct isoburn o,
int  flag 
)

Alters and writes the first 64 kB of a "medium" to invalidate an ISO image. (It shall stay restorable by skilled humans, though). The result shall especially keep libisoburn from accepting the medium image as ISO filesystem.

Parameters
oA fully activated isoburn object. isoburn_start_emulation() was already called.
Returns
<=0 error , 1 = success

Definition at line 673 of file isofs_wrap.c.

References isoburn::drive, isoburn_activate_session(), and isoburn::target_iso_head.

Referenced by isoburn_disc_erase().

◆ isoburn_read_image()

int isoburn_read_image ( struct burn_drive d,
struct isoburn_read_opts read_opts,
IsoImage **  image 
)

Load the ISO filesystem directory tree from the medium in the given drive. This will give libisoburn the base on which it can let libisofs perform image growing or image modification. The loaded volset gets attached to the drive object and handed out to the application. Not a wrapper, but peculiar to libisoburn.

Since
0.1.0
Parameters
dThe drive which holds an existing ISO filesystem or blank media. d is allowed to be NULL which produces an empty ISO image. In this case one has to call before writing isoburn_attach_volset() with the volset from this call and with the intended output drive.
read_optsThe read options which can be chosen by the application
imagethe image read, if the disc is blank it will have no files. This reference needs to be released via iso_image_unref() when it is not longer needed. The drive, if not NULL, will hold an own reference which it will release when it gets a new volset or when it gets released via isoburn_drive_release(). You can pass NULL if you already have a reference or you plan to obtain it later with isoburn_get_attached_image(). Of course, if you haven't specified a valid drive (i.e., if d == NULL), this parameter can't be NULL.
Returns
<=0 error , 1 = success

Definition at line 142 of file isofs_wrap.c.

References isoburn_read_opts::auto_input_charset, BURN_DISC_APPENDABLE, BURN_DISC_BLANK, BURN_DISC_FULL, isoburn_read_opts::cache_tile_blocks, isoburn_read_opts::cache_tiles, isoburn_read_opts::dirmode, isoburn_read_opts::displacement, isoburn_read_opts::displacement_sign, isoburn_read_opts::do_ecma119_map, isoburn_read_opts::do_joliet_map, isoburn_read_opts::gid, isoburn_read_opts::hasElTorito, isoburn_read_opts::hasIso1999, isoburn_read_opts::hasJoliet, isoburn_read_opts::hasRR, isoburn::image, isoburn::image_start_lba, isoburn_read_opts::input_charset, isoburn::iso_data_source, iso_data_source_unref(), iso_image_attach_data(), iso_image_get_ignore_aclea(), iso_image_import(), iso_image_new(), iso_image_ref(), iso_image_set_ignore_aclea(), iso_image_set_truncate_mode(), iso_image_unref(), iso_read_image_features_destroy(), iso_read_image_features_get_size(), iso_read_image_features_has_eltorito(), iso_read_image_features_has_iso1999(), iso_read_image_features_has_joliet(), iso_read_image_features_has_rockridge(), iso_read_image_features_rr_loaded(), iso_read_image_features_tree_loaded(), iso_read_opts_auto_input_charset(), iso_read_opts_free(), iso_read_opts_keep_import_src(), iso_read_opts_load_system_area(), iso_read_opts_new(), iso_read_opts_set_default_gid(), iso_read_opts_set_default_permissions(), iso_read_opts_set_default_uid(), iso_read_opts_set_ecma119_map(), iso_read_opts_set_input_charset(), iso_read_opts_set_joliet_map(), iso_read_opts_set_new_inos(), iso_read_opts_set_no_aaip(), iso_read_opts_set_no_iso1999(), iso_read_opts_set_no_joliet(), iso_read_opts_set_no_md5(), iso_read_opts_set_no_rockridge(), iso_read_opts_set_preferjoliet(), iso_read_opts_set_start_block(), iso_tree_set_report_callback(), isoburn_data_source_new(), isoburn_disc_get_msc1(), isoburn_disc_get_status(), isoburn_find_emulator(), isoburn_idle_free_function(), isoburn_msgs_submit(), isoburn_read_iso_head(), isoburn_report_iso_error(), isoburn_root_defaults(), isoburn_read_opts::joliet_map_mode, isoburn_read_opts::map_mode, isoburn_read_opts::mode, isoburn_read_opts::noaaip, isoburn_read_opts::noino, isoburn_read_opts::noiso1999, isoburn_read_opts::nojoliet, isoburn_read_opts::nomd5, isoburn_read_opts::norock, isoburn_read_opts::preferjoliet, isoburn_read_opts::pretend_blank, isoburn::read_pacifier, isoburn::read_pacifier_handle, isoburn_read_opts::rr_loaded, isoburn_read_opts::size, isoburn_read_opts::tree_loaded, isoburn_read_opts::truncate_length, isoburn_read_opts::truncate_mode, and isoburn_read_opts::uid.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_root_defaults()

int isoburn_root_defaults ( IsoImage image,
int  flag 
)

Initialize the root directory attributes of a freshly created image.

Definition at line 129 of file isofs_wrap.c.

References isoburn::image, iso_image_get_root(), and iso_node_set_permissions().

Referenced by isoburn_new(), and isoburn_read_image().

◆ isoburn_set_read_pacifier()

int isoburn_set_read_pacifier ( struct burn_drive drive,
int(*)(IsoImage *, IsoFileSource *)  read_pacifier,
void *  app_handle 
)

Set a callback function for producing pacifier messages during the lengthy process of image reading. The callback function and the application handle are stored until they are needed for the underlying call to libisofs. Other than with libisofs the handle is managed entirely by the application. An idle .free() function is exposed to libisofs. The handle has to stay valid until isoburn_read_image() is done. It has to be detached by isoburn_set_read_pacifier(drive, NULL, NULL); before it may be removed from memory.

Since
0.1.0
Parameters
driveThe drive which will be used with isoburn_read_image() It has to be acquired by an isoburn_* wrapper call.
read_pacifierThe callback function
app_handleThe app handle which the callback function can obtain via iso_image_get_attached_data() from its IsoImage*
Returns
1 success, <=0 failure

Definition at line 706 of file isofs_wrap.c.

References isoburn::drive, isoburn_find_emulator(), isoburn::read_pacifier, and isoburn::read_pacifier_handle.

Referenced by Xorriso_aquire_drive(), and Xorriso_create_empty_iso().

◆ isoburn_start_emulation()