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)  

rockridge.h File Reference
#include "ecma119.h"
Include dependency graph for rockridge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  susp_info
 
struct  susp_CE
 
struct  susp_SP
 
struct  susp_ER
 
struct  rr_PX
 
struct  rr_TF
 
struct  rr_PN
 
struct  rr_NM
 
struct  rr_CL
 
struct  rr_SL
 
struct  aaip_AA
 
struct  aaip_AL
 
struct  zisofs_ZF
 
struct  susp_sys_user_entry
 

Macros

#define SUSP_SIG(entry, a, b)   ((entry->sig[0] == a) && (entry->sig[1] == b))
 
#define ISO_SUSP_CE_ALLOC_STEP   16
 

Typedefs

typedef struct susp_iterator SuspIterator
 

Functions

size_t rrip_calc_len (Ecma119Image *t, Ecma119Node *n, int type, size_t space, size_t *ce, size_t base_ce)
 
int rrip_get_susp_fields (Ecma119Image *t, Ecma119Node *n, int type, size_t space, struct susp_info *info)
 
void rrip_write_susp_fields (Ecma119Image *t, struct susp_info *info, uint8_t *buf)
 
int rrip_write_ce_fields (Ecma119Image *t, struct susp_info *info)
 
SuspIteratorsusp_iter_new (IsoDataSource *src, struct ecma119_dir_record *record, uint32_t fs_blocks, uint8_t len_skp, int msgid)
 
int susp_iter_next (SuspIterator *iter, struct susp_sys_user_entry **sue, int flag)
 
void susp_iter_free (SuspIterator *iter)
 
int read_rr_PX (struct susp_sys_user_entry *px, struct stat *st)
 
int read_rr_TF (struct susp_sys_user_entry *tf, struct stat *st)
 
int read_rr_NM (struct susp_sys_user_entry *nm, char **name, int *cont)
 
int read_rr_SL (struct susp_sys_user_entry *sl, char **dest, int *cont)
 
int read_rr_PN (struct susp_sys_user_entry *pn, struct stat *st)
 
int read_aaip_AA (struct susp_sys_user_entry *sue, unsigned char **aa_string, size_t *aa_size, size_t *aa_len, size_t *prev_field, int *is_done, int flag)
 
int read_aaip_AL (struct susp_sys_user_entry *sue, unsigned char **aa_string, size_t *aa_size, size_t *aa_len, size_t *prev_field, int *is_done, int flag)
 
int read_zisofs_ZF (struct susp_sys_user_entry *zf, uint8_t algorithm[2], uint8_t *header_size_div4, uint8_t *block_size_log2, uint64_t *uncompressed_size, int flag)
 
int iso_get_rr_name (IsoWriteOpts *opts, char *input_charset, char *output_charset, int imgid, char *str, char **name, int flag)
 

Macro Definition Documentation

◆ ISO_SUSP_CE_ALLOC_STEP

#define ISO_SUSP_CE_ALLOC_STEP   16

Definition at line 79 of file rockridge.h.

◆ SUSP_SIG

#define SUSP_SIG (   entry,
  a,
 
)    ((entry->sig[0] == a) && (entry->sig[1] == b))

This header defines the functions and structures needed to add RockRidge extensions to an ISO image. It also handles AAIP and zisofs extensions.

References:

Definition at line 45 of file rockridge.h.

Typedef Documentation

◆ SuspIterator

typedef struct susp_iterator SuspIterator

The SUSP iterator is used to iterate over the System User Entries of a ECMA-168 directory record. It takes care about Continuation Areas, handles the end of the different system user entries and skip padding areas. Thus, using an iteration we are accessing just to the meaning entries.

Definition at line 244 of file rockridge.h.

Function Documentation

◆ iso_get_rr_name()

int iso_get_rr_name ( IsoWriteOpts opts,
char *  input_charset,
char *  output_charset,
int  imgid,
char *  str,
char **  name,
int  flag 
)

Convert a RR filename to the requested charset.

Parameters
flagbit0= do not issue error messages

Convert a RR filename to the requested charset. On any conversion error, the original name will be used.

Parameters
flagbit0= do not issue error messages

Definition at line 367 of file rockridge.c.

References iso_clone_mem(), ISO_FILENAME_WRONG_CHARSET, iso_msg_submit(), ISO_SUCCESS, and strconv().

Referenced by get_rr_fname(), and iso_conv_name_chars().

◆ read_aaip_AA()

int read_aaip_AA ( struct susp_sys_user_entry sue,
unsigned char **  aa_string,
size_t *  aa_size,
size_t *  aa_len,
size_t *  prev_field,
int *  is_done,
int  flag 
)

Collects the AAIP field string from single AAIP fields. (see doc/susp_aaip_1_0.txt)

Parameters
aa_stringStorage location of the emerging string. Begin with *aa_string == NULL, or own malloc() storage.
aa_sizeCurrent allocated size of aa_string. Begin with *aa_size == 0, or own storage size.
aa_lenCurrent occupied size of aa_string. Begin with *aa_len == 0
prev_fieldReturns the index of start of the previous field in the string.
is_doneThe current completion state of the AAIP field string. Fields will be ignored as soon as it is 1. Begin with *is_done == 0
flagUnused yet. Submit 0.
Returns
1 on success, < 0 on error

Definition at line 493 of file rockridge_read.c.

References susp_sys_user_entry::AL, aaip_AL::comps, susp_sys_user_entry::data, aaip_AL::flags, ISO_OUT_OF_MEM, ISO_SUCCESS, ISO_WRONG_RR, susp_sys_user_entry::len_sue, and susp_sys_user_entry::version.

◆ read_aaip_AL()

int read_aaip_AL ( struct susp_sys_user_entry sue,
unsigned char **  aa_string,
size_t *  aa_size,
size_t *  aa_len,
size_t *  prev_field,
int *  is_done,
int  flag 
)

Collects the AAIP field string from single AL fields. (see doc/susp_aaip_2_0.txt)

Definition at line 567 of file rockridge_read.c.

References susp_sys_user_entry::AL, aaip_AL::comps, susp_sys_user_entry::data, aaip_AL::flags, ISO_OUT_OF_MEM, ISO_SUCCESS, ISO_WRONG_RR, susp_sys_user_entry::len_sue, and susp_sys_user_entry::version.

◆ read_rr_NM()

int read_rr_NM ( struct susp_sys_user_entry nm,
char **  name,
int *  cont 
)

Read a RR NM entry (RRIP, 4.1.4), and appends the name stored there to the given name. You can pass a pointer to NULL as name.

Returns
1 on success, < 0 on error

Definition at line 318 of file rockridge_read.c.

References susp_sys_user_entry::data, rr_NM::flags, ISO_NULL_POINTER, ISO_OUT_OF_MEM, ISO_SUCCESS, iso_util_strcopy(), ISO_WRONG_ARG_VALUE, ISO_WRONG_RR, susp_sys_user_entry::len_sue, rr_NM::name, susp_sys_user_entry::NM, and susp_sys_user_entry::sig.

◆ read_rr_PN()

int read_rr_PN ( struct susp_sys_user_entry pn,
struct stat *  st 
)

Fills a struct stat with the values of a Rock Ridge PN entry (RRIP, 4.1.2).

Returns
1 on success, < 0 on error

Definition at line 457 of file rockridge_read.c.

References susp_sys_user_entry::data, rr_PN::high, ISO_NULL_POINTER, iso_read_bb(), ISO_SUCCESS, ISO_WRONG_ARG_VALUE, ISO_WRONG_RR, susp_sys_user_entry::len_sue, rr_PN::low, susp_sys_user_entry::PN, and susp_sys_user_entry::sig.

◆ read_rr_PX()

int read_rr_PX ( struct susp_sys_user_entry px,
struct stat *  st 
)

Fills a struct stat with the values of a Rock Ridge PX entry (RRIP, 4.1.1).

Returns
< 0 on error 1 on success with no inode number, 2 on success with inode number,

Fills a struct stat with the values of a Rock Ridge PX entry (RRIP, 4.1.1).

Returns
1 on success, < 0 on error

Definition at line 190 of file rockridge_read.c.

References susp_sys_user_entry::data, rr_PX::gid, ISO_NULL_POINTER, iso_read_bb(), ISO_WRONG_ARG_VALUE, ISO_WRONG_RR, susp_sys_user_entry::len_sue, rr_PX::links, rr_PX::mode, susp_sys_user_entry::PX, rr_PX::serial, susp_sys_user_entry::sig, and rr_PX::uid.

◆ read_rr_SL()

int read_rr_SL ( struct susp_sys_user_entry sl,
char **  dest,
int *  cont 
)

Read a SL RR entry (RRIP, 4.1.3), checking if the destination continues.

Parameters
cont0 not continue, 1 continue, 2 continue component
Returns
1 on success, < 0 on error

Definition at line 368 of file rockridge_read.c.

References rr_SL::comps, susp_sys_user_entry::data, rr_SL::flags, ISO_NULL_POINTER, ISO_OUT_OF_MEM, ISO_SUCCESS, ISO_UNSUPPORTED_RR, iso_util_strcopy(), ISO_WRONG_ARG_VALUE, susp_sys_user_entry::len_sue, susp_sys_user_entry::sig, and susp_sys_user_entry::SL.

◆ read_rr_TF()

int read_rr_TF ( struct susp_sys_user_entry tf,
struct stat *  st 
)

Fills a struct stat with the values of a Rock Ridge TF entry (RRIP, 4.1.6)

Returns
1 on success, < 0 on error

Definition at line 223 of file rockridge_read.c.

References susp_sys_user_entry::data, rr_TF::flags, iso_datetime_read_17(), iso_datetime_read_7(), ISO_NULL_POINTER, ISO_SUCCESS, ISO_WRONG_ARG_VALUE, ISO_WRONG_RR, susp_sys_user_entry::len_sue, susp_sys_user_entry::sig, rr_TF::t_stamps, and susp_sys_user_entry::TF.

◆ read_zisofs_ZF()

int read_zisofs_ZF ( struct susp_sys_user_entry zf,
uint8_t  algorithm[2],
uint8_t *  header_size_div4,
uint8_t *  block_size_log2,
uint64_t *  uncompressed_size,
int  flag 
)

Reads the zisofs parameters from a ZF field (see doc/zisofs_format.txt).

Returns
1 on success, < 0 on error

Reads the zisofs parameters from a ZF field (see doc/zisofs_format.txt and doc/zisofs2_format.txt).

Returns
1 on success, < 0 on error

Definition at line 626 of file rockridge_read.c.

References susp_sys_user_entry::data, ISO_NULL_POINTER, iso_read_bb(), iso_read_lsb64(), ISO_SUCCESS, ISO_WRONG_ARG_VALUE, ISO_WRONG_RR, susp_sys_user_entry::len_sue, zisofs_ZF::parameters, susp_sys_user_entry::sig, susp_sys_user_entry::version, and susp_sys_user_entry::ZF.

◆ rrip_calc_len()

size_t rrip_calc_len ( Ecma119Image t,
Ecma119Node n,
int  type,
size_t  used_up,
size_t *  ce,
size_t  base_ce 
)

Compute the length needed for write all RR and SUSP entries for a given node.

Parameters
type0 normal entry, 1 "." entry for that node (it is a dir), 2 ".." for that node (i.e., it will refer to the parent)
spaceAvailable space in the System Use Area for the directory record.
ceWill be filled with the space needed in a CE
base_ceFill of continuation area by previous nodes of same dir
Returns
The size needed for the RR entries in the System Use Area

Compute the length needed for write all RR and SUSP entries for a given node.

Parameters
type0 normal entry, 1 "." entry for that node (it is a dir), 2 ".." for that node (i.e., it will refer to the parent)
used_upAlready occupied space in the directory record.
ceWill be filled with the space needed in a CE
base_cePredicted fill of continuation area by previous nodes of same dir
Returns
The size needed for the RR entries in the System Use Area

Definition at line 1483 of file rockridge.c.

References iso_write_opts::aaip, iso_write_opts::aaip_susp_1_10, add_aa_string(), ecma119_node::dir, ECMA119_DIR, ecma119_is_dedicated_reloc_dir(), ECMA119_PLACEHOLDER, ECMA119_SPECIAL, Iso_Image::id, ecma119_image::image, ecma119_node::info, ISO_ASSERT_FAILURE, iso_msg_submit(), ISO_OUT_OF_MEM, ISO_ROCKRIDGE_IN_DIR_REC, Iso_Node::mode, ecma119_node::node, ecma119_image::opts, ecma119_node::parent, ecma119_dir_info::real_parent, iso_write_opts::rr_reloc_flags, iso_write_opts::rrip_1_10_px_ino, iso_write_opts::rrip_version_1_10, susp_calc_nm_sl_al(), and ecma119_node::type.

Referenced by calc_dir_size().

◆ rrip_get_susp_fields()

int rrip_get_susp_fields ( Ecma119Image t,
Ecma119Node n,
int  type,
size_t  used_up,
struct susp_info info 
)

Fill a struct susp_info with the RR/SUSP entries needed for a given node.

Parameters
type0 normal entry, 1 "." entry for that node (it is a dir), 2 ".." for that node (i.e., it will refer to the parent)
spaceAvailable space in the System Use Area for the directory record.
infoPointer to the struct susp_info where the entries will be stored. If some entries need to go to a Continuation Area, they will be added to the existing ce_susp_fields, and ce_len will be incremented properly. Please ensure ce_block is initialized properly.
Returns
1 success, < 0 error

Fill a struct susp_info with the RR/SUSP entries needed for a given node.

Parameters
type0 normal entry, 1 "." entry for that node (it is a dir), 2 ".." for that node (i.e., it will refer to the parent)
used_upAlready occupied space in the directory record.
infoPointer to the struct susp_info where the entries will be stored. If some entries need to go to a Continuation Area, they will be added to the existing ce_susp_fields, and ce_len will be incremented properly. Please ensure ce_block is initialized properly.
Returns
1 success, < 0 error

Definition at line 1636 of file rockridge.c.

References iso_write_opts::aaip, aaip_add_ER(), iso_write_opts::aaip_susp_1_10, add_aa_string(), add_zf_field(), BLOCK_SIZE, susp_info::ce_len, susp_info::current_ce_start, ecma119_node::dir, ECMA119_DIR, ecma119_is_dedicated_reloc_dir(), ECMA119_PLACEHOLDER, ECMA119_SPECIAL, ECMA119_SYMLINK, get_rr_fname(), Iso_Image::id, ecma119_image::image, ecma119_node::info, ISO_ASSERT_FAILURE, iso_msg_submit(), ecma119_node::iso_name, ISO_NULL_POINTER, ISO_OUT_OF_MEM, ISO_ROCKRIDGE_IN_DIR_REC, ISO_SUCCESS, Iso_Node::mode, susp_info::n_ce_susp_fields, Iso_Node::name, ecma119_node::node, ecma119_image::opts, ecma119_node::parent, pseudo_susp_add_PAD(), ecma119_dir_info::real_parent, iso_write_opts::rr_reloc_flags, rrip_add_CL(), rrip_add_ER(), rrip_add_NM(), rrip_add_PL(), rrip_add_PN(), rrip_add_PX(), rrip_add_RE(), rrip_add_SL(), rrip_add_TF(), rrip_SL_append_comp(), iso_write_opts::rrip_version_1_10, susp_info::suf_len, susp_add_CE(), susp_add_ES(), susp_add_SP(), susp_calc_nm_sl_al(), susp_info_free(), and ecma119_node::type.

Referenced by write_one_dir().

◆ rrip_write_ce_fields()

int rrip_write_ce_fields ( Ecma119Image t,
struct susp_info info 
)

Write the Continuation Area entries for the given struct susp_info, using the iso_write() function. After written, the ce_susp_fields array will be freed.

Definition at line 2270 of file rockridge.c.

References susp_info::alloc_ce_susp_fields, BLOCK_SIZE, susp_info::ce_len, susp_info::ce_susp_fields, ISO_SUCCESS, iso_write(), LIBISO_ALLOC_MEM, LIBISO_FREE_MEM, and susp_info::n_ce_susp_fields.

Referenced by write_one_dir().

◆ rrip_write_susp_fields()

void rrip_write_susp_fields ( Ecma119Image t,
struct susp_info info,
uint8_t *  buf 
)

Write the given SUSP fields into buf. Note that Continuation Area fields are not written. If info does not contain any SUSP entry this function just return. After written, the info susp_fields array will be freed, and the counters updated properly.

Definition at line 2235 of file rockridge.c.

References susp_info::n_susp_fields, susp_info::suf_len, susp_info::susp_fields, and susp_update_CE_sizes().

Referenced by write_one_dir_record().

◆ susp_iter_free()

void susp_iter_free ( SuspIterator iter)

Free a given susp iterator.

Definition at line 178 of file rockridge_read.c.

References susp_iterator::buffer.

Referenced by read_root_susp_entries().

◆ susp_iter_new()

◆ susp_iter_next()

int susp_iter_next ( SuspIterator iter,
struct susp_sys_user_entry **  sue,
int  flag 
)

Get the next SUSP System User Entry using given iterator.

Parameters
suePointer to the next susp entry. It refers to an internal buffer and it's not guaranteed to be allocated after calling susp_iter_next() again. Thus, if you need to keep some entry you have to do a copy.
Returns
1 on success, 0 if no more entries, < 0 error

Definition at line 81 of file rockridge_read.c.

References susp_iterator::base, susp_CE::block, BLOCK_SIZE, susp_iterator::buffer, susp_sys_user_entry::CE, susp_iterator::ce_block, susp_iterator::ce_len, susp_iterator::ce_off, susp_sys_user_entry::data, DIV_UP, susp_iterator::fs_blocks, iso_msg_submit(), iso_read_bb(), ISO_SUCCESS, ISO_SUSP_MAX_CE_BYTES, ISO_SUSP_WRONG_CE_SIZE, ISO_UNSUPPORTED_SUSP, ISO_WRONG_RR, susp_CE::len, susp_sys_user_entry::len_sue, susp_iterator::msgid, susp_CE::offset, susp_iterator::pos, iso_data_source::read_block, susp_iterator::size, susp_iterator::src, susp_iter_next(), and SUSP_SIG.

Referenced by read_root_susp_entries(), and susp_iter_next().