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)  

joliet.c File Reference
#include "joliet.h"
#include "messages.h"
#include "writer.h"
#include "image.h"
#include "filesrc.h"
#include "eltorito.h"
#include "libisofs.h"
#include "util.h"
#include "ecma119.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for joliet.c:

Go to the source code of this file.


int iso_get_joliet_name (IsoWriteOpts *opts, char *input_charset, int imgid, char *node_name, enum IsoNodeType node_type, size_t *joliet_ucs2_failures, uint16_t **name, int flag)
static int get_joliet_name (Ecma119Image *t, IsoNode *iso, uint16_t **name)
static void joliet_node_free (JolietNode *node)
static int create_node (Ecma119Image *t, IsoNode *iso, JolietNode **node)
static int create_tree (Ecma119Image *t, IsoNode *iso, JolietNode **tree, int pathlen)
static int cmp_node (const void *f1, const void *f2)
static void sort_tree (JolietNode *root)
static int cmp_node_name (const void *f1, const void *f2)
static int joliet_create_mangled_name (uint16_t *dest, uint16_t *src, int digits, int number, uint16_t *ext)
static int mangle_single_dir (Ecma119Image *t, JolietNode *dir)
static int mangle_tree (Ecma119Image *t, JolietNode *dir)
static int joliet_tree_create (Ecma119Image *t)
static size_t calc_dirent_len (Ecma119Image *t, JolietNode *n)
static size_t calc_dir_size (Ecma119Image *t, JolietNode *dir)
static void calc_dir_pos (Ecma119Image *t, JolietNode *dir)
static uint32_t calc_path_table_size (JolietNode *dir)
static int joliet_writer_compute_data_blocks (IsoImageWriter *writer)
static void write_one_dir_record (Ecma119Image *t, JolietNode *node, int file_id, uint8_t *buf, size_t len_fi, int extent)
static void ucsncpy_pad (uint16_t *dest, const uint16_t *src, size_t max)
int joliet_writer_write_vol_desc (IsoImageWriter *writer)
static int write_one_dir (Ecma119Image *t, JolietNode *dir)
static int write_dirs (Ecma119Image *t, JolietNode *root)
static int write_path_table (Ecma119Image *t, JolietNode **pathlist, int l_type)
static int write_path_tables (Ecma119Image *t)
static int joliet_writer_write_dirs (IsoImageWriter *writer)
static int joliet_writer_write_data (IsoImageWriter *writer)
static int joliet_writer_free_data (IsoImageWriter *writer)
int joliet_writer_create (Ecma119Image *target)

Function Documentation

◆ calc_dir_pos()

◆ calc_dir_size()

static size_t calc_dir_size ( Ecma119Image t,
JolietNode dir 

Computes the total size of all directory entries of a single joliet dir. This is like ECMA-119, but taking care that names are stored in UCS.

Definition at line 691 of file joliet.c.

References BLOCK_SIZE, calc_dirent_len(), joliet_dir_info::children, joliet_node::dir, joliet_node::file, joliet_node::info, JOLIET_FILE, joliet_dir_info::len, joliet_dir_info::nchildren, Iso_File_Src::nsections, ROUND_UP, and joliet_node::type.

Referenced by calc_dir_pos().

◆ calc_dirent_len()

static size_t calc_dirent_len ( Ecma119Image t,
JolietNode n 

Compute the size of a directory entry for a single node

Definition at line 674 of file joliet.c.

References JOLIET_FILE, joliet_node::name, iso_write_opts::omit_version_numbers, ecma119_image::opts, joliet_node::type, and ucslen().

Referenced by calc_dir_size().

◆ calc_path_table_size()

static uint32_t calc_path_table_size ( JolietNode dir)

Compute the length of the joliet path table, in bytes.

Definition at line 749 of file joliet.c.

References joliet_dir_info::children, joliet_node::dir, joliet_node::info, JOLIET_DIR, joliet_node::name, joliet_dir_info::nchildren, joliet_node::type, and ucslen().

Referenced by joliet_writer_compute_data_blocks().

◆ cmp_node()

static int cmp_node ( const void *  f1,
const void *  f2 

Definition at line 328 of file joliet.c.

References joliet_node::name, and ucscmp().

Referenced by sort_tree().

◆ cmp_node_name()

static int cmp_node_name ( const void *  f1,
const void *  f2 

Definition at line 352 of file joliet.c.

References joliet_node::name, and ucscmp().

Referenced by mangle_single_dir().

◆ create_node()

◆ create_tree()

◆ get_joliet_name()

static int get_joliet_name ( Ecma119Image t,
IsoNode iso,
uint16_t **  name 

◆ iso_get_joliet_name()

int iso_get_joliet_name ( IsoWriteOpts opts,
char *  input_charset,
int  imgid,
char *  node_name,
enum IsoNodeType  node_type,
size_t *  joliet_ucs2_failures,
uint16_t **  name,
int  flag 

◆ joliet_create_mangled_name()

static int joliet_create_mangled_name ( uint16_t *  dest,
uint16_t *  src,
int  digits,
int  number,
uint16_t *  ext 

Definition at line 360 of file joliet.c.

References ISO_ASSERT_FAILURE, iso_msb(), ISO_SUCCESS, str2ucs(), ucslen(), and ucsncpy().

Referenced by mangle_single_dir().

◆ joliet_node_free()

◆ joliet_tree_create()

◆ joliet_writer_compute_data_blocks()

◆ joliet_writer_create()

◆ joliet_writer_free_data()

static int joliet_writer_free_data ( IsoImageWriter writer)

◆ joliet_writer_write_data()

◆ joliet_writer_write_dirs()

static int joliet_writer_write_dirs ( IsoImageWriter writer)

◆ joliet_writer_write_vol_desc()

int joliet_writer_write_vol_desc ( IsoImageWriter writer)

Definition at line 926 of file joliet.c.

References ecma119_sup_vol_desc::abstract_file_id, Iso_Image::abstract_file_id, ecma119_sup_vol_desc::application_id, Iso_Image::application_id, Iso_Image::biblio_file_id, ecma119_sup_vol_desc::bibliographic_file_id, BLOCK_SIZE, ecma119_sup_vol_desc::block_size, ecma119_sup_vol_desc::copyright_file_id, Iso_Image::copyright_file_id, ecma119_sup_vol_desc::data_prep_id, Iso_Image::data_preparer_id, ecma119_set_voldescr_times(), ecma119_image::eff_partition_offset, ecma119_sup_vol_desc::esc_sequences, ecma119_sup_vol_desc::file_structure_version, Iso_Image::id, ecma119_image::image, ecma119_image::input_charset, iso_bb(), iso_lsb(), iso_msb(), iso_msg_debug(), ISO_OUT_OF_MEM, iso_write(), ecma119_image::j_part_l_path_table_pos, ecma119_image::j_part_m_path_table_pos, ecma119_image::j_part_root, ecma119_image::joliet_l_path_table_pos, ecma119_image::joliet_m_path_table_pos, ecma119_image::joliet_path_table_size, ecma119_image::joliet_root, ecma119_sup_vol_desc::l_path_table_pos, ecma119_sup_vol_desc::m_path_table_pos, ecma119_sup_vol_desc::path_table_size, ecma119_sup_vol_desc::publisher_id, Iso_Image::publisher_id, ecma119_sup_vol_desc::root_dir_record, ecma119_sup_vol_desc::std_identifier, str2ucs(), ecma119_sup_vol_desc::system_id, Iso_Image::system_id, Iso_Image_Writer::target, ucsncpy_pad(), ecma119_sup_vol_desc::vol_desc_type, ecma119_sup_vol_desc::vol_desc_version, ecma119_sup_vol_desc::vol_seq_number, ecma119_sup_vol_desc::vol_set_id, ecma119_sup_vol_desc::vol_set_size, ecma119_image::vol_space_size, ecma119_sup_vol_desc::vol_space_size, Iso_Image::volset_id, ecma119_sup_vol_desc::volume_id, Iso_Image::volume_id, and write_one_dir_record().

Referenced by ecma119_image_new(), joliet_writer_create(), and write_head_part2().

◆ mangle_single_dir()

◆ mangle_tree()

static int mangle_tree ( Ecma119Image t,
JolietNode dir 

◆ sort_tree()

static void sort_tree ( JolietNode root)

◆ ucsncpy_pad()

static void ucsncpy_pad ( uint16_t *  dest,
const uint16_t *  src,
size_t  max 

Copy up to max characters from src to dest. If src has less than max characters, we pad dest with " " characters.

Definition at line 899 of file joliet.c.

References iso_handle_split_utf16(), MIN, and ucslen().

Referenced by joliet_writer_write_vol_desc().

◆ write_dirs()

◆ write_one_dir()

◆ write_one_dir_record()

static void write_one_dir_record ( Ecma119Image t,
JolietNode node,
int  file_id,
uint8_t *  buf,
size_t  len_fi,
int  extent 

Write a single directory record for Joliet. It is like (ECMA-119, 9.1), but file identifier is stored in UCS.

file_idif >= 0, we use it instead of the filename (for "." and ".." entries).
len_fiComputed length of the file identifier. Total size of the directory entry will be len + 34 (ECMA-119, 9.1.12), as padding is always needed

Definition at line 829 of file joliet.c.

References iso_write_opts::always_gmt, joliet_dir_info::block, iso_file_section::block, joliet_node::dir, iso_write_opts::dir_rec_mtime, ecma119_image::eff_partition_offset, joliet_node::file, joliet_node::info, iso_bb(), iso_datetime_7(), JOLIET_DIR, JOLIET_FILE, joliet_dir_info::len, Iso_Node::mtime, joliet_node::name, joliet_node::node, ecma119_image::now, Iso_File_Src::nsections, iso_write_opts::omit_version_numbers, ecma119_image::opts, joliet_node::parent, ecma119_image::replace_timestamps, Iso_File_Src::sections, iso_file_section::size, ecma119_image::timestamp, and joliet_node::type.

Referenced by joliet_writer_write_vol_desc(), and write_one_dir().

◆ write_path_table()

◆ write_path_tables()