Clarified meaning of "ISO 9660:1999" as Enhanced Volume Descriptor of ECMA-119 4th Edition

This commit is contained in:
Thomas Schmitt 2024-10-06 11:08:47 +02:00
parent eed1e64aed
commit 6a100a645d
4 changed files with 58 additions and 35 deletions

View File

@ -19,6 +19,10 @@ Contents:
-------------------------------------------------------------------------------
1. References:
Meanwhile this is specified in ECMA-119 4th Edition of 2019 by the description
of the Enhanced Volume Descriptor.
The old name "ISO 9660:1999" comes from:
ISO/IEC DIS 9660:1999(E) "Information processing. Volume and file structure of
CD­-ROM for Information Interchange"

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2011-2014 Thomas Schmitt
* Copyright (c) 2011-2024 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@ -59,7 +59,7 @@ int get_iso1999_name(Ecma119Image *t, const char *str, char **fname)
}
}
/* ISO 9660:1999 7.5.1 */
/* ISO 9660:1999 7.5.1 and ECMA-119 4th Edition 7.5.1 */
if (strlen(name) > 207) {
name[207] = '\0';
}
@ -90,7 +90,8 @@ void iso1999_node_free(Iso1999Node *node)
}
/**
* Create a low level ISO 9660:1999 node
* Create a low level node of the tree of Enhanced Volume Descriptor
* (aka ISO 9660:1999) as of ECMA-119 4th Edition.
* @return
* 1 success, 0 ignored, < 0 error
*/
@ -172,7 +173,8 @@ int create_node(Ecma119Image *t, IsoNode *iso, Iso1999Node **node)
}
/**
* Create the low level ISO 9660:1999 tree from the high level ISO tree.
* Create the low level tree of an Enhanced Volume Descriptor
* (aka ISO 9660:1999) as of ECMA-119 4th Edition from the high level ISO tree.
*
* @return
* 1 success, 0 file ignored, < 0 error
@ -300,8 +302,8 @@ cmp_node(const void *f1, const void *f2)
Iso1999Node *g = *((Iso1999Node**)f2);
/**
* TODO #00027 Follow ISO 9660:1999 specs when sorting files
* strcmp do not does exactly what ISO 9660:1999, 9.3, as characters
* TODO #00027 Follow ECMA-119 4th Edition specs when sorting files
* strcmp do not does exactly what paragraph 9.3 prescribe, as characters
* < 0x20 " " are allowed, so name len must be taken into account
*/
return strcmp(f->name, g->name);
@ -309,7 +311,7 @@ cmp_node(const void *f1, const void *f2)
/**
* Sort the entries inside an ISO 9660:1999 directory, according to
* ISO 9660:1999, 9.3
* ISO 9660:1999 / ECMA-119 4th Edition, 9.3
*/
static
void sort_tree(Iso1999Node *root)
@ -585,7 +587,7 @@ size_t calc_dirent_len(Ecma119Image *t, Iso1999Node *n)
/**
* Computes the total size of all directory entries of a single dir, as
* stated in ISO 9660:1999, 6.8.1.3
* stated in ISO 9660:1999 / ECMA-119 4th Edition, 6.8.1.3
*/
static
size_t calc_dir_size(Ecma119Image *t, Iso1999Node *dir)
@ -616,7 +618,7 @@ size_t calc_dir_size(Ecma119Image *t, Iso1999Node *dir)
/*
* The size of a dir is always a multiple of block size, as we must add
* the size of the unused space after the last directory record
* (ISO 9660:1999, 6.8.1.3)
* (ISO 9660:1999 / ECMA-119 4th Edition, 6.8.1.3)
*/
len = ROUND_UP(len, BLOCK_SIZE);
@ -643,7 +645,8 @@ void calc_dir_pos(Ecma119Image *t, Iso1999Node *dir)
}
/**
* Compute the length of the path table (ISO 9660:1999, 6.9), in bytes.
* Compute the length of the path table (ISO 9660:1999 / ECMA-119 4th Edition,
* 6.9), in bytes.
*/
static
uint32_t calc_path_table_size(Iso1999Node *dir)
@ -699,7 +702,7 @@ int iso1999_writer_compute_data_blocks(IsoImageWriter *writer)
}
/**
* Write a single directory record (ISO 9660:1999, 9.1).
* Write a single directory record (ISO 9660:1999 / ECMA-119 4th Edition, 9.1).
*
* @param file_id
* if >= 0, we use it instead of the filename (for "." and ".." entries).
@ -765,7 +768,8 @@ void write_one_dir_record(Ecma119Image *t, Iso1999Node *node, int file_id,
}
/**
* Write the enhanced volume descriptor (ISO/IEC 9660:1999, 8.5)
* Write the enhanced volume descriptor
* (ISO/IEC 9660:1999 / ECMA-119 4th Edition, 8.5)
*/
static
int iso1999_writer_write_vol_desc(IsoImageWriter *writer)
@ -806,7 +810,9 @@ int iso1999_writer_write_vol_desc(IsoImageWriter *writer)
vol.vol_desc_type[0] = 2;
memcpy(vol.std_identifier, "CD001", 5);
/* descriptor version is 2 (ISO/IEC 9660:1999, 8.5.2) */
/* descriptor version is 2
* (ISO/IEC 9660:1999 / ECMA-119 4th Edition, 8.5.2)
*/
vol.vol_desc_version[0] = 2;
strncpy_pad((char*)vol.volume_id, vol_id, 32);
@ -1052,7 +1058,9 @@ int iso1999_writer_write_data(IsoImageWriter *writer)
static
int iso1999_writer_free_data(IsoImageWriter *writer)
{
/* free the ISO 9660:1999 tree */
/* free the ISO 9660:1999 / ECMA-119 4th Edition Enhanced Volume Descriptor
* tree
*/
Ecma119Image *t = writer->target;
iso1999_node_free(t->iso1999_root);
return ISO_SUCCESS;

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2024 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@ -8,11 +9,11 @@
*/
/**
* Structures related to ISO/IEC 9660:1999, that is version 2 of ISO-9660
* "See doc/devel/cookbook/ISO 9660-1999" and
* ISO/IEC DIS 9660:1999(E) "Information processing. Volume and file structure
* of CD­-ROM for Information Interchange"
* for further details.
* Structures related to the Enhanced Volume Descriptor as of ECMA-119 4th
* Edition. See there and in "doc/devel/cookbook/ISO 9660-1999" for further
* details.
* This optional tree is also known as ISO/IEC DIS 9660:1999, a once proposed
* version 2 of ISO-9660.
*/
#ifndef LIBISO_ISO1999_H
@ -49,7 +50,7 @@ struct iso1999_node
};
/**
* Create a IsoWriter to deal with ISO 9660:1999 estructures, and add it to
* Create a IsoWriter to deal with ISO 9660:1999 structures, and add it to
* the given target.
*
* @return

View File

@ -304,7 +304,10 @@ enum IsoHideNodeFlag {
LIBISO_HIDE_ON_RR = 1 << 0,
/** Hide the node in the Joliet tree, if Joliet extension are enabled */
LIBISO_HIDE_ON_JOLIET = 1 << 1,
/** Hide the node in the ISO-9660:1999 tree, if that format is enabled */
/** Hide the node in the tree of an Enhanced Volume Descriptor
(aka ISO 9660:1999) as of ECMA-119 4th Edition, if that format is
enabled
*/
LIBISO_HIDE_ON_1999 = 1 << 2,
/** Hide the node in the HFS+ tree, if that format is enabled.
@ -1557,11 +1560,12 @@ int iso_write_opts_set_hfsp_block_size(IsoWriteOpts *opts,
/**
* Whether to use newer ISO-9660:1999 version.
* Whether to create an additional tree starting at Enhanced Volume Descriptor
* (aka ISO 9660:1999) as of ECMA-119 4th Edition.
*
* This is the second version of ISO-9660. It allows longer filenames and has
* less restrictions than old ISO-9660. However, nobody is using it so there
* are no much reasons to enable this.
* This allows longer filenames and has less restrictions than ECMA-119 2nd
* Edition aka ISO-9660:1988. However, nobody is using it. So there are
* not many reasons to enable this.
*
* @since 0.6.2
*/
@ -1889,8 +1893,9 @@ int iso_write_opts_set_aaip_susp_1_10(IsoWriteOpts *opts, int oldvers);
* iso_write_opts_set_replace_timestamps() apply. (replace==1 will revoke,
* replace==2 will override mtime by iso_write_opts_set_default_timestamp().
*
* Since version 1.2.0 this may apply also to Joliet and ISO 9660:1999. To
* reduce the probability of unwanted behavior changes between pre-1.2.0 and
* Since version 1.2.0 this may apply also to Joliet and an Enhanced Volume
* Descriptor tree (aka ISO 9660:1999) as of ECMA-119 4th Edition.
* To reduce the probability of unwanted behavior changes between pre-1.2.0 and
* post-1.2.0, the bits for Joliet and ISO 9660:1999 also enable ECMA-119.
* The hopefully unlikely bit14 may then be used to disable mtime for ECMA-119.
*
@ -2342,8 +2347,9 @@ int iso_write_opts_set_disc_label(IsoWriteOpts *opts, char *label);
/**
* Explicitly set the four timestamps of the emerging Primary Volume
* Descriptor and in the volume descriptors of Joliet and ISO 9660:1999,
* if those are to be generated.
* Descriptor, in the volume descriptor of Joliet, and in the Enhanced Volume
* Descriptor (aka ISO 9660:1999) as of ECMA-119 4th Edition, if those are
* to be generated.
* Default with all parameters is 0.
*
* ECMA-119 defines them as:
@ -3052,7 +3058,8 @@ int iso_read_opts_set_no_rockridge(IsoReadOpts *opts, int norr);
int iso_read_opts_set_no_joliet(IsoReadOpts *opts, int nojoliet);
/**
* Do not read ISO 9660:1999 enhanced tree
* Do not read the tree of an Enhanced Volume Descriptor (aka ISO 9660:1999)
* as of ECMA-119 4th Edition.
*
* @since 0.6.2
*/
@ -3360,8 +3367,8 @@ int iso_read_image_features_has_rockridge(IsoReadImageFeatures *f);
int iso_read_image_features_has_joliet(IsoReadImageFeatures *f);
/**
* Whether the image is recorded according to ISO 9660:1999, i.e. it has
* a version 2 Enhanced Volume Descriptor.
* Whether the image is recorded with an Enhanced Volume Descriptor
* (aka ISO 9660:1999) as of ECMA-119 4th Edition.
*
* @since 0.6.2
*/
@ -3376,7 +3383,9 @@ int iso_read_image_features_has_eltorito(IsoReadImageFeatures *f);
/**
* Tells what directory tree was loaded:
* 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999
* 0 = ISO 9660 , 1 = Joliet ,
* 2 = Enhanced Volume Descriptor tree as of ECMA-119 4th Edition
* (aka ISO 9660:1999)
*
* @since 1.5.4
*/
@ -5367,7 +5376,8 @@ time_t iso_node_get_ctime(const IsoNode *node);
/**
* Set whether the node will be hidden in the directory trees of RR/ISO 9660,
* or of Joliet (if enabled at all), or of ISO-9660:1999 (if enabled at all).
* or of Joliet (if enabled at all), or of an Enhanced Volume Descriptor
* (aka ISO 9660:1999) as of ECMA-119 4th Edition (if enabled at all).
*
* A hidden file does not show up by name in the affected directory tree.
* For example, if a file is hidden only in Joliet, it will normally