"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/libisofs.h" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

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.

libisofs.h  (xorriso-1.5.2):libisofs.h  (xorriso-1.5.4)
#ifndef LIBISO_LIBISOFS_H_ #ifndef LIBISO_LIBISOFS_H_
#define LIBISO_LIBISOFS_H_ #define LIBISO_LIBISOFS_H_
/* /*
* Copyright (c) 2007-2008 Vreixo Formoso, Mario Danic * Copyright (c) 2007-2008 Vreixo Formoso, Mario Danic
* Copyright (c) 2009-2019 Thomas Schmitt * Copyright (c) 2009-2021 Thomas Schmitt
* *
* This file is part of the libisofs project; you can redistribute it and/or * 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 * modify it under the terms of the GNU General Public License version 2
* or later as published by the Free Software Foundation. * or later as published by the Free Software Foundation.
* See COPYING file for details. * See COPYING file for details.
*/ */
/* Important: If you add a public API function then add its name to file /* Important: If you add a public API function then add its name to file
libisofs/libisofs.ver libisofs/libisofs.ver
*/ */
skipping to change at line 94 skipping to change at line 94
* Note to anybody who does own work inside libisofs: * Note to anybody who does own work inside libisofs:
* Any change of configure.ac or libisofs.h has to keep up this equality ! * Any change of configure.ac or libisofs.h has to keep up this equality !
* *
* Before usage of these macros on your code, please read the usage discussion * Before usage of these macros on your code, please read the usage discussion
* below. * below.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
#define iso_lib_header_version_major 1 #define iso_lib_header_version_major 1
#define iso_lib_header_version_minor 5 #define iso_lib_header_version_minor 5
#define iso_lib_header_version_micro 2 #define iso_lib_header_version_micro 4
/** /**
* Get version of the libisofs library at runtime. * Get version of the libisofs library at runtime.
* NOTE: This function may be called before iso_init(). * NOTE: This function may be called before iso_init().
* *
* @since 0.6.2 * @since 0.6.2
*/ */
void iso_lib_version(int *major, int *minor, int *micro); void iso_lib_version(int *major, int *minor, int *micro);
/** /**
skipping to change at line 119 skipping to change at line 119
* 1 lib is compatible, 0 is not. * 1 lib is compatible, 0 is not.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_lib_is_compatible(int major, int minor, int micro); int iso_lib_is_compatible(int major, int minor, int micro);
/** /**
* Usage discussion: * Usage discussion:
* *
* Some developers of the libburnia project have differing opinions how to * Some developers of the libburnia project have differing opinions how to
* ensure the compatibility of libaries and applications. * ensure the compatibility of libraries and applications.
* *
* It is about whether to use at compile time and at runtime the version * It is about whether to use at compile time and at runtime the version
* numbers provided here. Thomas Schmitt advises to use them. Vreixo Formoso * numbers provided here. Thomas Schmitt advises to use them. Vreixo Formoso
* advises to use other means. * advises to use other means.
* *
* At compile time: * At compile time:
* *
* Vreixo Formoso advises to leave proper version matching to properly * Vreixo Formoso advises to leave proper version matching to properly
* programmed checks in the the application's build system, which will * programmed checks in the the application's build system, which will
* eventually refuse compilation. * eventually refuse compilation.
skipping to change at line 318 skipping to change at line 318
/** Hide the node in the FAT tree, if that format is enabled. /** Hide the node in the FAT tree, if that format is enabled.
@since 1.2.4 @since 1.2.4
*/ */
LIBISO_HIDE_ON_FAT = 1 << 5, LIBISO_HIDE_ON_FAT = 1 << 5,
/** With IsoNode and IsoBoot: Write data content even if the node is /** With IsoNode and IsoBoot: Write data content even if the node is
* not visible in any tree. * not visible in any tree.
* With directory nodes : Write data content of IsoNode and IsoBoot * With directory nodes : Write data content of IsoNode and IsoBoot
* in the directory's tree unless they are * in the directory's tree unless they are
* explicitely marked LIBISO_HIDE_ON_RR * explicitly marked LIBISO_HIDE_ON_RR
* without LIBISO_HIDE_BUT_WRITE. * without LIBISO_HIDE_BUT_WRITE.
* @since 0.6.34 * @since 0.6.34
*/ */
LIBISO_HIDE_BUT_WRITE = 1 << 3 LIBISO_HIDE_BUT_WRITE = 1 << 3
}; };
/** /**
* El-Torito bootable image type. * El-Torito bootable image type.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
enum eltorito_boot_media_type { enum eltorito_boot_media_type {
ELTORITO_FLOPPY_EMUL, ELTORITO_FLOPPY_EMUL,
ELTORITO_HARD_DISC_EMUL, ELTORITO_HARD_DISC_EMUL,
ELTORITO_NO_EMUL ELTORITO_NO_EMUL
}; };
/** /**
* Replace mode used when addding a node to a directory. * Replace mode used when adding a node to a directory.
* This controls how libisofs will act when you tried to add to a dir a file * This controls how libisofs will act when you tried to add to a dir a file
* with the same name that an existing file. * with the same name that an existing file.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
enum iso_replace_mode { enum iso_replace_mode {
/** /**
* Never replace an existing node, and instead fail with * Never replace an existing node, and instead fail with
* ISO_NODE_NAME_NOT_UNIQUE. * ISO_NODE_NAME_NOT_UNIQUE.
*/ */
skipping to change at line 451 skipping to change at line 451
* Read an arbitrary block (2048 bytes) of data from the source. * Read an arbitrary block (2048 bytes) of data from the source.
* *
* @param lba * @param lba
* Block to be read. * Block to be read.
* @param buffer * @param buffer
* Buffer where the data will be written. It should have at least * Buffer where the data will be written. It should have at least
* 2048 bytes. * 2048 bytes.
* @return * @return
* 1 if success, * 1 if success,
* < 0 if error. This function has to emit a valid libisofs error code. * < 0 if error. This function has to emit a valid libisofs error code.
* Predifined (but not mandatory) for this purpose are: * Predefined (but not mandatory) for this purpose are:
* ISO_DATA_SOURCE_SORRY , ISO_DATA_SOURCE_MISHAP, * ISO_DATA_SOURCE_SORRY , ISO_DATA_SOURCE_MISHAP,
* ISO_DATA_SOURCE_FAILURE , ISO_DATA_SOURCE_FATAL * ISO_DATA_SOURCE_FAILURE , ISO_DATA_SOURCE_FATAL
*/ */
int (*read_block)(IsoDataSource *src, uint32_t lba, uint8_t *buffer); int (*read_block)(IsoDataSource *src, uint32_t lba, uint8_t *buffer);
/** /**
* Clean up the source specific data. Never call this directly, it is * Clean up the source specific data. Never call this directly, it is
* automatically called by iso_data_source_unref() when refcount reach * automatically called by iso_data_source_unref() when refcount reach
* 0. * 0.
*/ */
skipping to change at line 592 skipping to change at line 592
* *
* To get a identifier for your filesystem implementation you should * To get a identifier for your filesystem implementation you should
* use iso_fs_global_id, incrementing it by one each time. * use iso_fs_global_id, incrementing it by one each time.
* *
* Otherwise, if you can't ensure values in the struct stat are valid, * Otherwise, if you can't ensure values in the struct stat are valid,
* this should return 0. * this should return 0.
*/ */
unsigned int (*get_id)(IsoFilesystem *fs); unsigned int (*get_id)(IsoFilesystem *fs);
/** /**
* Opens the filesystem for several read operations. Calling this funcion * Opens the filesystem for several read operations. Calling this function
* is not needed at all, each time that the underlying system resource * is not needed at all, each time that the underlying system resource
* needs to be accessed, it is openned propertly. * needs to be accessed, it is opened property.
* However, if you plan to execute several operations on the filesystem, * However, if you plan to execute several operations on the filesystem,
* it is a good idea to open it previously, to prevent several open/close * it is a good idea to open it previously, to prevent several open/close
* operations to occur. * operations to occur.
* *
* @return 1 on success, < 0 on error (has to be a valid libisofs error code ) * @return 1 on success, < 0 on error (has to be a valid libisofs error code )
*/ */
int (*open)(IsoFilesystem *fs); int (*open)(IsoFilesystem *fs);
/** /**
* Close the filesystem, thus freeing all system resources. You should * Close the filesystem, thus freeing all system resources. You should
skipping to change at line 726 skipping to change at line 726
* ISO_FILE_ACCESS_DENIED * ISO_FILE_ACCESS_DENIED
* ISO_FILE_BAD_PATH * ISO_FILE_BAD_PATH
* ISO_FILE_DOESNT_EXIST * ISO_FILE_DOESNT_EXIST
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_FILE_ERROR * ISO_FILE_ERROR
* ISO_NULL_POINTER * ISO_NULL_POINTER
*/ */
int (*open)(IsoFileSource *src); int (*open)(IsoFileSource *src);
/** /**
* Close a previuously openned file * Close a previously opened file
* @return 1 on success, < 0 on error * @return 1 on success, < 0 on error
* Error codes: * Error codes:
* ISO_FILE_ERROR * ISO_FILE_ERROR
* ISO_NULL_POINTER * ISO_NULL_POINTER
* ISO_FILE_NOT_OPENED * ISO_FILE_NOT_OPENED
*/ */
int (*close)(IsoFileSource *src); int (*close)(IsoFileSource *src);
/** /**
* Attempts to read up to count bytes from the given source into * Attempts to read up to count bytes from the given source into
skipping to change at line 808 skipping to change at line 808
* ISO_FILE_IS_NOT_SYMLINK * ISO_FILE_IS_NOT_SYMLINK
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_FILE_BAD_PATH * ISO_FILE_BAD_PATH
* ISO_FILE_DOESNT_EXIST * ISO_FILE_DOESNT_EXIST
* *
*/ */
int (*readlink)(IsoFileSource *src, char *buf, size_t bufsiz); int (*readlink)(IsoFileSource *src, char *buf, size_t bufsiz);
/** /**
* Get the filesystem for this source. No extra ref is added, so you * Get the filesystem for this source. No extra ref is added, so you
* musn't unref the IsoFilesystem. * must not unref the IsoFilesystem.
* *
* @return * @return
* The filesystem, NULL on error * The filesystem, NULL on error
*/ */
IsoFilesystem* (*get_filesystem)(IsoFileSource *src); IsoFilesystem* (*get_filesystem)(IsoFileSource *src);
/** /**
* Free implementation specific data. Should never be called by user. * Free implementation specific data. Should never be called by user.
* Use iso_file_source_unref() instead. * Use iso_file_source_unref() instead.
*/ */
skipping to change at line 1516 skipping to change at line 1516
*/ */
int iso_write_opts_set_hfsp_serial_number(IsoWriteOpts *opts, int iso_write_opts_set_hfsp_serial_number(IsoWriteOpts *opts,
uint8_t serial_number[8]); uint8_t serial_number[8]);
/** /**
* Set the block size for Apple Partition Map and for HFS+. * Set the block size for Apple Partition Map and for HFS+.
* *
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
* @param hfsp_block_size * @param hfsp_block_size
* The allocation block size to be used by the HFS+ fileystem. * The allocation block size to be used by the HFS+ filesystem.
* 0, 512, or 2048 * 0, 512, or 2048
* @param apm_block_size * @param apm_block_size
* The block size to be used for and within the Apple Partition Map. * The block size to be used for and within the Apple Partition Map.
* 0, 512, or 2048. * 0, 512, or 2048.
* Size 512 is not compatible with options which produce GPT. * Size 512 is not compatible with options which produce GPT.
* @return * @return
* 1 success, < 0 error * 1 success, < 0 error
* *
* @since 1.2.4 * @since 1.2.4
*/ */
skipping to change at line 1545 skipping to change at line 1545
* are no much reasons to enable this. * are no much reasons to enable this.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_write_opts_set_iso1999(IsoWriteOpts *opts, int enable); int iso_write_opts_set_iso1999(IsoWriteOpts *opts, int enable);
/** /**
* Control generation of non-unique inode numbers for the emerging image. * Control generation of non-unique inode numbers for the emerging image.
* Inode numbers get written as "file serial number" with PX entries as of * Inode numbers get written as "file serial number" with PX entries as of
* RRIP-1.12. They may mark families of hardlinks. * RRIP-1.12. They may mark families of hardlinks.
* RRIP-1.10 prescribes a PX entry without file serial number. If not overriden * RRIP-1.10 prescribes a PX entry without file serial number.If not overridden
* by iso_write_opts_set_rrip_1_10_px_ino() there will be no file serial number * by iso_write_opts_set_rrip_1_10_px_ino() there will be no file serial number
* written into RRIP-1.10 images. * written into RRIP-1.10 images.
* *
* Inode number generation does not affect IsoNode objects which imported their * Inode number generation does not affect IsoNode objects which imported their
* inode numbers from the old ISO image (see iso_read_opts_set_new_inos()) * inode numbers from the old ISO image (see iso_read_opts_set_new_inos())
* and which have not been altered since import. It rather applies to IsoNode * and which have not been altered since import. It rather applies to IsoNode
* objects which were newly added to the image, or to IsoNode which brought no * objects which were newly added to the image, or to IsoNode which brought no
* inode number from the old image, or to IsoNode where certain properties * inode number from the old image, or to IsoNode where certain properties
* have been altered since image import. * have been altered since image import.
* *
skipping to change at line 1574 skipping to change at line 1574
* properties. * properties.
* 0 = Generate unique inode numbers for all IsoNode objects which do not * 0 = Generate unique inode numbers for all IsoNode objects which do not
* have a valid inode number from an imported ISO image. * have a valid inode number from an imported ISO image.
* All other values are reserved. * All other values are reserved.
* *
* @since 0.6.20 * @since 0.6.20
*/ */
int iso_write_opts_set_hardlinks(IsoWriteOpts *opts, int enable); int iso_write_opts_set_hardlinks(IsoWriteOpts *opts, int enable);
/** /**
* Control writing of AAIP informations for ACL and xattr. * Control writing of AAIP information for ACL and xattr.
* For importing ACL and xattr when inserting nodes from external filesystems * For importing ACL and xattr when inserting nodes from external filesystems
* (e.g. the local POSIX filesystem) see iso_image_set_ignore_aclea(). * (e.g. the local POSIX filesystem) see iso_image_set_ignore_aclea().
* For loading of this information from images see iso_read_opts_set_no_aaip(). * For loading of this information from images see iso_read_opts_set_no_aaip().
* *
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
* @param enable * @param enable
* 1 = write AAIP information from nodes into the image * 1 = write AAIP information from nodes into the image
* 0 = do not write AAIP information into the image * 0 = do not write AAIP information into the image
* All other values are reserved. * All other values are reserved.
skipping to change at line 1786 skipping to change at line 1786
* The option set to be manipulated. * The option set to be manipulated.
* @param allow * @param allow
* If not zero, then allow what is described above. * If not zero, then allow what is described above.
* *
* @since 1.2.2 * @since 1.2.2
*/ */
int iso_write_opts_set_allow_7bit_ascii(IsoWriteOpts *opts, int allow); int iso_write_opts_set_allow_7bit_ascii(IsoWriteOpts *opts, int allow);
/** /**
* Allow all characters to be part of Volume and Volset identifiers on * Allow all characters to be part of Volume and Volset identifiers on
* the Primary Volume Descriptor. This breaks ISO-9660 contraints, but * the Primary Volume Descriptor. This breaks ISO-9660 constraints, but
* should work on modern systems. * should work on modern systems.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_write_opts_set_relaxed_vol_atts(IsoWriteOpts *opts, int allow); int iso_write_opts_set_relaxed_vol_atts(IsoWriteOpts *opts, int allow);
/** /**
* Allow paths in the Joliet tree to have more than 240 characters. * Allow paths in the Joliet tree to have more than 240 characters.
* This breaks Joliet specification. Use with caution. * This breaks Joliet specification. Use with caution.
* *
skipping to change at line 2116 skipping to change at line 2116
* provide a different ms_block if you don't plan to burn the image in the * provide a different ms_block if you don't plan to burn the image in the
* first session on disc, such as in some CD-Extra disc whether the data * first session on disc, such as in some CD-Extra disc whether the data
* image is written in a new session after some audio tracks. * image is written in a new session after some audio tracks.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_write_opts_set_ms_block(IsoWriteOpts *opts, uint32_t ms_block); int iso_write_opts_set_ms_block(IsoWriteOpts *opts, uint32_t ms_block);
/** /**
* Sets the buffer where to store the descriptors which shall be written * Sets the buffer where to store the descriptors which shall be written
* at the beginning of an overwriteable media to point to the newly written * at the beginning of an overwritable media to point to the newly written
* image. * image.
* This is needed if the write start address of the image is not 0. * This is needed if the write start address of the image is not 0.
* In this case the first 64 KiB of the media have to be overwritten * In this case the first 64 KiB of the media have to be overwritten
* by the buffer content after the session was written and the buffer * by the buffer content after the session was written and the buffer
* was updated by libisofs. Otherwise the new session would not be * was updated by libisofs. Otherwise the new session would not be
* found by operating system function mount() or by libisoburn. * found by operating system function mount() or by libisoburn.
* (One could still mount that session if its start address is known.) * (One could still mount that session if its start address is known.)
* *
* If you do not need this information, for example because you are creating a * If you do not need this information, for example because you are creating a
* new image for LBA 0 or because you will create an image for a true * new image for LBA 0 or because you will create an image for a true
* multisession media, just do not use this call or set buffer to NULL. * multisession media, just do not use this call or set buffer to NULL.
* *
* Use cases: * Use cases:
* *
* - Together with iso_write_opts_set_appendable(opts, 1) the buffer serves * - Together with iso_write_opts_set_appendable(opts, 1) the buffer serves
* for the growing of an image as done in growisofs by Andy Polyakov. * for the growing of an image as done in growisofs by Andy Polyakov.
* This allows appending of a new session to non-multisession media, such * This allows appending of a new session to non-multisession media, such
* as DVD+RW. The new session will refer to the data of previous sessions * as DVD+RW. The new session will refer to the data of previous sessions
* on the same media. * on the same media.
* libisoburn emulates multisession appendability on overwriteable media * libisoburn emulates multisession appendability on overwritable media
* and disk files by performing this use case. * and disk files by performing this use case.
* *
* - Together with iso_write_opts_set_appendable(opts, 0) the buffer allows * - Together with iso_write_opts_set_appendable(opts, 0) the buffer allows
* to write the first session on overwriteable media to start addresses * to write the first session on overwritable media to start addresses
* other than 0. * other than 0.
* This address must not be smaller than 32 blocks plus the eventual * This address must not be smaller than 32 blocks plus the eventual
* partition offset as defined by iso_write_opts_set_part_offset(). * partition offset as defined by iso_write_opts_set_part_offset().
* libisoburn in most cases writes the first session on overwriteable media * libisoburn in most cases writes the first session on overwritable media
* and disk files to LBA (32 + partition_offset) in order to preserve its * and disk files to LBA (32 + partition_offset) in order to preserve its
* descriptors from the subsequent overwriting by the descriptor buffer of * descriptors from the subsequent overwriting by the descriptor buffer of
* later sessions. * later sessions.
* *
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
* @param overwrite * @param overwrite
* When not NULL, it should point to at least 64KiB of memory, where * When not NULL, it should point to at least 64KiB of memory, where
* libisofs will install the contents that shall be written at the * libisofs will install the contents that shall be written at the
* beginning of overwriteable media. * beginning of overwritable media.
* You should initialize the buffer either with 0s, or with the contents * You should initialize the buffer either with 0s, or with the contents
* of the first 32 blocks of the image you are growing. In most cases, * of the first 32 blocks of the image you are growing. In most cases,
* 0 is good enought. * 0 is good enough.
* IMPORTANT: If you use iso_write_opts_set_part_offset() then the * IMPORTANT: If you use iso_write_opts_set_part_offset() then the
* overwrite buffer must be larger by the offset defined there. * overwrite buffer must be larger by the offset defined there.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_write_opts_set_overwrite_buf(IsoWriteOpts *opts, uint8_t *overwrite); int iso_write_opts_set_overwrite_buf(IsoWriteOpts *opts, uint8_t *overwrite);
/** /**
* Set the size, in number of blocks, of the ring buffer used between the * Set the size, in number of blocks, of the ring buffer used between the
* writer thread and the burn_source. You have to provide at least a 32 * writer thread and the burn_source. You have to provide at least a 32
skipping to change at line 2302 skipping to change at line 2302
* The option set to be manipulated. * The option set to be manipulated.
* @param label * @param label
* A text of up to 128 characters. * A text of up to 128 characters.
* @return * @return
* ISO_SUCCESS or error * ISO_SUCCESS or error
* @since 0.6.40 * @since 0.6.40
*/ */
int iso_write_opts_set_disc_label(IsoWriteOpts *opts, char *label); int iso_write_opts_set_disc_label(IsoWriteOpts *opts, char *label);
/** /**
* Explicitely set the four timestamps of the emerging Primary Volume * Explicitly set the four timestamps of the emerging Primary Volume
* Descriptor and in the volume descriptors of Joliet and ISO 9660:1999, * Descriptor and in the volume descriptors of Joliet and ISO 9660:1999,
* if those are to be generated. * if those are to be generated.
* Default with all parameters is 0. * Default with all parameters is 0.
* *
* ECMA-119 defines them as: * ECMA-119 defines them as:
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
* @param vol_creation_time * @param vol_creation_time
* When "the information in the volume was created." * When "the information in the volume was created."
* A value of 0 means that the timepoint of write start is to be used. * A value of 0 means that the timepoint of write start is to be used.
skipping to change at line 2383 skipping to change at line 2383
*/ */
int iso_write_opts_set_part_offset(IsoWriteOpts *opts, int iso_write_opts_set_part_offset(IsoWriteOpts *opts,
uint32_t block_offset_2k, uint32_t block_offset_2k,
int secs_512_per_head, int heads_per_cyl); int secs_512_per_head, int heads_per_cyl);
/** The minimum version of libjte to be used with this version of libisofs /** The minimum version of libjte to be used with this version of libisofs
at compile time. The use of libjte is optional and depends on configure at compile time. The use of libjte is optional and depends on configure
tests. It can be prevented by ./configure option --disable-libjte . tests. It can be prevented by ./configure option --disable-libjte .
@since 0.6.38 @since 0.6.38
*/ */
#define iso_libjte_req_major 1 #define iso_libjte_req_major 2
#define iso_libjte_req_minor 0 #define iso_libjte_req_minor 0
#define iso_libjte_req_micro 0 #define iso_libjte_req_micro 0
/** /**
* Associate a libjte environment object to the upcoming write run. * Associate a libjte environment object to the upcoming write run.
* libjte implements Jigdo Template Extraction as of Steve McIntyre and * libjte implements Jigdo Template Extraction as of Steve McIntyre and
* Richard Atterer. * Richard Atterer.
* The call will fail if no libjte support was enabled at compile time. * The call will fail if no libjte support was enabled at compile time.
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
skipping to change at line 2628 skipping to change at line 2628
* *
* @since 1.2.4 * @since 1.2.4
*/ */
int iso_write_opts_set_efi_bootp(IsoWriteOpts *opts, char *image_path, int iso_write_opts_set_efi_bootp(IsoWriteOpts *opts, char *image_path,
int flag); int flag);
/** /**
* Control whether the emerging GPT gets a pseudo-randomly generated disk GUID * Control whether the emerging GPT gets a pseudo-randomly generated disk GUID
* or whether it gets a user supplied GUID. * or whether it gets a user supplied GUID.
* The partition GUIDs will be generated in a reproducible way by exoring the * The partition GUIDs will be generated in a reproducible way by exoring the
* little-endian 32 bit partion number with the disk GUID beginning at byte * little-endian 32 bit partition number with the disk GUID beginning at byte
* offset 9. * offset 9.
* *
* @param opts * @param opts
* The option set to be manipulated. * The option set to be manipulated.
* @param guid * @param guid
* 16 bytes of user supplied GUID. Readily byte-swapped from the text * 16 bytes of user supplied GUID. Readily byte-swapped from the text
* form as prescribed by UEFI specs: * form as prescribed by UEFI specs:
* 4 byte, 2 byte, 2 byte as little-endian. * 4 byte, 2 byte, 2 byte as little-endian.
* 2 byte, 6 byte as big-endian. * 2 byte, 6 byte as big-endian.
* The upper 4 bit of guid[7] should bear the value 4 to express the * The upper 4 bit of guid[7] should bear the value 4 to express the
skipping to change at line 2982 skipping to change at line 2982
int iso_read_opts_set_no_joliet(IsoReadOpts *opts, int nojoliet); int iso_read_opts_set_no_joliet(IsoReadOpts *opts, int nojoliet);
/** /**
* Do not read ISO 9660:1999 enhanced tree * Do not read ISO 9660:1999 enhanced tree
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_read_opts_set_no_iso1999(IsoReadOpts *opts, int noiso1999); int iso_read_opts_set_no_iso1999(IsoReadOpts *opts, int noiso1999);
/** /**
* Control reading of AAIP informations about ACL and xattr when loading * Control reading of AAIP information about ACL and xattr when loading
* existing images. * existing images.
* For importing ACL and xattr when inserting nodes from external filesystems * For importing ACL and xattr when inserting nodes from external filesystems
* (e.g. the local POSIX filesystem) see iso_image_set_ignore_aclea(). * (e.g. the local POSIX filesystem) see iso_image_set_ignore_aclea().
* For eventual writing of this information see iso_write_opts_set_aaip(). * For eventual writing of this information see iso_write_opts_set_aaip().
* *
* @param opts * @param opts
* The option set to be manipulated * The option set to be manipulated
* @param noaaip * @param noaaip
* 1 = Do not read AAIP information * 1 = Do not read AAIP information
* 0 = Read AAIP information if available * 0 = Read AAIP information if available
skipping to change at line 3060 skipping to change at line 3060
/** /**
* How to convert file names if neither Rock Ridge nor Joliet names * How to convert file names if neither Rock Ridge nor Joliet names
* are present and acceptable. * are present and acceptable.
* *
* @param opts * @param opts
* The option set to be manipulated * The option set to be manipulated
* @param ecma119_map * @param ecma119_map
* The conversion mode to apply: * The conversion mode to apply:
* 0 = unmapped: Take name as recorded in ECMA-119 directory record * 0 = unmapped: Take name as recorded in ECMA-119 directory record
* (not suitable for writing them to a new ISO filesystem) * (not suitable for writing it to a new ISO filesystem)
* 1 = stripped: Like unmapped, but strip off trailing ";1" or ".;1" * 1 = stripped: Like unmapped, but strip off trailing ";1" or ".;1"
* 2 = uppercase: Like stripped, but map {a-z} to {A-Z} * 2 = uppercase: Like stripped, but map {a-z} to {A-Z}
* 3 = lowercase: Like stripped, but map {A-Z} to {a-z} * 3 = lowercase: Like stripped, but map {A-Z} to {a-z}
* @return * @return
* ISO_SUCCESS if ecma119_map was accepted * ISO_SUCCESS if ecma119_map was accepted
* 0 if the value was out of range * 0 if the value was out of range
* < 0 if other error * < 0 if other error
* *
* @since 1.4.2 * @since 1.4.2
*/ */
int iso_read_opts_set_ecma119_map(IsoReadOpts *opts, int ecma119_map); int iso_read_opts_set_ecma119_map(IsoReadOpts *opts, int ecma119_map);
/** /**
* How to convert Joliet file names.
*
* @param opts
* The option set to be manipulated
* @param ecma119_map
* The conversion mode to apply:
* 0 = unmapped: Take name as recorded in Joliet directory record
* (not suitable for writing it to a new ISO filesystem)
* 1 = stripped: Strip off trailing ";1" or ".;1"
* @return
* ISO_SUCCESS if joliet_map was accepted
* 0 if the value was out of range
* < 0 if other error
*
* @since 1.5.4
*/
int iso_read_opts_set_joliet_map(IsoReadOpts *opts, int joliet_map);
/**
* Set default uid for files when RR extensions are not present. * Set default uid for files when RR extensions are not present.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_read_opts_set_default_uid(IsoReadOpts *opts, uid_t uid); int iso_read_opts_set_default_uid(IsoReadOpts *opts, uid_t uid);
/** /**
* Set default gid for files when RR extensions are not present. * Set default gid for files when RR extensions are not present.
* *
* @since 0.6.2 * @since 0.6.2
skipping to change at line 3245 skipping to change at line 3264
int iso_read_image_features_has_iso1999(IsoReadImageFeatures *f); int iso_read_image_features_has_iso1999(IsoReadImageFeatures *f);
/** /**
* Whether El-Torito boot record is present present in the image imported. * Whether El-Torito boot record is present present in the image imported.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_read_image_features_has_eltorito(IsoReadImageFeatures *f); int iso_read_image_features_has_eltorito(IsoReadImageFeatures *f);
/** /**
* Tells what directory tree was loaded:
* 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999
*
* @since 1.5.4
*/
int iso_read_image_features_tree_loaded(IsoReadImageFeatures *f);
/**
* Tells whether Rock Ridge information was used while loading the tree:
* 1= yes, 0= no
*
* @since 1.5.4
*/
int iso_read_image_features_rr_loaded(IsoReadImageFeatures *f);
/**
* Increments the reference counting of the given image. * Increments the reference counting of the given image.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
void iso_image_ref(IsoImage *image); void iso_image_ref(IsoImage *image);
/** /**
* Decrements the reference couting of the given image. * Decrements the reference counting of the given image.
* If it reaches 0, the image is free, together with its tree nodes (whether * If it reaches 0, the image is free, together with its tree nodes (whether
* their refcount reach 0 too, of course). * their refcount reach 0 too, of course).
* *
* @since 0.6.2 * @since 0.6.2
*/ */
void iso_image_unref(IsoImage *image); void iso_image_unref(IsoImage *image);
/** /**
* Attach user defined data to the image. Use this if your application needs * 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 * to store addition info together with the IsoImage. If the image already
skipping to change at line 3275 skipping to change at line 3310
* @param image * @param image
* The image to which data shall be attached. * The image to which data shall be attached.
* @param data * @param data
* Pointer to application defined data that will be attached to the * Pointer to application defined data that will be attached to the
* image. You can pass NULL to remove any already attached data. * image. You can pass NULL to remove any already attached data.
* @param give_up * @param give_up
* Function that will be called when the image does not need the data * 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 * any more. It receives the data pointer as an argumente, and eventually
* causes data to be freed. It can be NULL if you don't need it. * causes data to be freed. It can be NULL if you don't need it.
* @return * @return
* 1 on succes, < 0 on error * 1 on success, < 0 on error
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_image_attach_data(IsoImage *image, void *data, void (*give_up)(void*)); int iso_image_attach_data(IsoImage *image, void *data, void (*give_up)(void*));
/** /**
* The the data previously attached with iso_image_attach_data() * The the data previously attached with iso_image_attach_data()
* *
* @since 0.6.2 * @since 0.6.2
*/ */
skipping to change at line 3839 skipping to change at line 3874
* @since 0.6.32 * @since 0.6.32
*/ */
int el_torito_get_boot_media_type(ElToritoBootImage *bootimg, int el_torito_get_boot_media_type(ElToritoBootImage *bootimg,
enum eltorito_boot_media_type *media_type); enum eltorito_boot_media_type *media_type);
/** /**
* Sets the platform ID of the boot image. * Sets the platform ID of the boot image.
* *
* The Platform ID gets written into the boot catalog at byte 1 of the * The Platform ID gets written into the boot catalog at byte 1 of the
* Validation Entry, or at byte 1 of a Section Header Entry. * Validation Entry, or at byte 1 of a Section Header Entry.
* If Platform ID and ID String of two consequtive bootimages are the same * If Platform ID and ID String of two consecutive bootimages are the same
* *
* @param bootimg * @param bootimg
* The image to manipulate. * The image to manipulate.
* @param id * @param id
* A Platform ID as of * A Platform ID as of
* El Torito 1.0 : 0x00= 80x86, 0x01= PowerPC, 0x02= Mac * El Torito 1.0 : 0x00= 80x86, 0x01= PowerPC, 0x02= Mac
* Others : 0xef= EFI * Others : 0xef= EFI
* @return * @return
* 1 ok , <=0 error * 1 ok , <=0 error
* *
skipping to change at line 4748 skipping to change at line 4783
int iso_image_get_alpha_boot(IsoImage *img, char **boot_loader_path); int iso_image_get_alpha_boot(IsoImage *img, char **boot_loader_path);
/** /**
* Increments the reference counting of the given node. * Increments the reference counting of the given node.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
void iso_node_ref(IsoNode *node); void iso_node_ref(IsoNode *node);
/** /**
* Decrements the reference couting of the given node. * Decrements the reference counting of the given node.
* If it reach 0, the node is free, and, if the node is a directory, * If it reach 0, the node is free, and, if the node is a directory,
* its children will be unref() too. * its children will be unref() too.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
void iso_node_unref(IsoNode *node); void iso_node_unref(IsoNode *node);
/** /**
* Get the type of an IsoNode. * Get the type of an IsoNode.
* *
skipping to change at line 4856 skipping to change at line 4891
* @return * @return
* 1 on success, 0 if node does not have extended info of the requested * 1 on success, 0 if node does not have extended info of the requested
* type, < 0 on error * type, < 0 on error
* *
* @since 0.6.4 * @since 0.6.4
*/ */
int iso_node_get_xinfo(IsoNode *node, iso_node_xinfo_func proc, void **data); int iso_node_get_xinfo(IsoNode *node, iso_node_xinfo_func proc, void **data);
/** /**
* Get the next pair of function pointer and data of an iteration of the * Get the next pair of function pointer and data of an iteration of the
* list of extended informations. Like: * list of extended information. Like:
* iso_node_xinfo_func proc; * iso_node_xinfo_func proc;
* void *handle = NULL, *data; * void *handle = NULL, *data;
* while (iso_node_get_next_xinfo(node, &handle, &proc, &data) == 1) { * while (iso_node_get_next_xinfo(node, &handle, &proc, &data) == 1) {
* ... make use of proc and data ... * ... make use of proc and data ...
* } * }
* The iteration allocates no memory. So you may end it without any disposal * The iteration allocates no memory. So you may end it without any disposal
* action. * action.
* IMPORTANT: Do not continue iterations after manipulating the extended * IMPORTANT: Do not continue iterations after manipulating the extended
* information of a node. Memory corruption hazard ! * information of a node. Memory corruption hazard !
* @param node * @param node
skipping to change at line 5175 skipping to change at line 5210
* the dir where to add the node * the dir where to add the node
* @param child * @param child
* the node to add. You must ensure that the node hasn't previously added * the node to add. You must ensure that the node hasn't previously added
* to other dir, and that the node name is unique inside the child. * to other dir, and that the node name is unique inside the child.
* Otherwise this function will return a failure, and the child won't be * Otherwise this function will return a failure, and the child won't be
* inserted. * inserted.
* @param replace * @param replace
* if the dir already contains a node with the same name, whether to * if the dir already contains a node with the same name, whether to
* replace or not the old node with this. * replace or not the old node with this.
* @return * @return
* number of nodes in dir if succes, < 0 otherwise * number of nodes in dir if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if dir or child are NULL * ISO_NULL_POINTER, if dir or child are NULL
* ISO_NODE_ALREADY_ADDED, if child is already added to other dir * ISO_NODE_ALREADY_ADDED, if child is already added to other dir
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_WRONG_ARG_VALUE, if child == dir, or replace != (0,1) * ISO_WRONG_ARG_VALUE, if child == dir, or replace != (0,1)
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_dir_add_node(IsoDir *dir, IsoNode *child, int iso_dir_add_node(IsoDir *dir, IsoNode *child,
enum iso_replace_mode replace); enum iso_replace_mode replace);
skipping to change at line 5304 skipping to change at line 5339
* *
* @since 0.6.2 * @since 0.6.2
*/ */
IsoDir *iso_node_get_parent(IsoNode *node); IsoDir *iso_node_get_parent(IsoNode *node);
/** /**
* Get an iterator for the children of the given dir. * Get an iterator for the children of the given dir.
* *
* You can iterate over the children with iso_dir_iter_next. When finished, * You can iterate over the children with iso_dir_iter_next. When finished,
* you should free the iterator with iso_dir_iter_free. * you should free the iterator with iso_dir_iter_free.
* You musn't delete a child of the same dir, using iso_node_take() or * You must not delete a child of the same dir, using iso_node_take() or
* iso_node_remove(), while you're using the iterator. You can use * iso_node_remove(), while you're using the iterator. You can use
* iso_dir_iter_take() or iso_dir_iter_remove() instead. * iso_dir_iter_take() or iso_dir_iter_remove() instead.
* *
* You can use the iterator in the way like this * You can use the iterator in the way like this
* *
* IsoDirIter *iter; * IsoDirIter *iter;
* IsoNode *node; * IsoNode *node;
* if ( iso_dir_get_children(dir, &iter) != 1 ) { * if ( iso_dir_get_children(dir, &iter) != 1 ) {
* // handle error * // handle error
* } * }
skipping to change at line 5379 skipping to change at line 5414
/** /**
* Removes a child from a directory during an iteration, without freeing it. * Removes a child from a directory during an iteration, without freeing it.
* It's like iso_node_take(), but to be used during a directory iteration. * It's like iso_node_take(), but to be used during a directory iteration.
* The node removed will be the last returned by the iteration. * The node removed will be the last returned by the iteration.
* *
* If you call this function twice without calling iso_dir_iter_next between * If you call this function twice without calling iso_dir_iter_next between
* them is not allowed and you will get an ISO_ERROR in second call. * them is not allowed and you will get an ISO_ERROR in second call.
* *
* @return * @return
* 1 on succes, < 0 error * 1 on success, < 0 error
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if iter is NULL * ISO_NULL_POINTER, if iter is NULL
* ISO_ERROR, on wrong iter usage, for example by call this before * ISO_ERROR, on wrong iter usage, for example by call this before
* iso_dir_iter_next. * iso_dir_iter_next.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_dir_iter_take(IsoDirIter *iter); int iso_dir_iter_take(IsoDirIter *iter);
/** /**
* Removes a child from a directory during an iteration and unref() it. * Removes a child from a directory during an iteration and unref() it.
* Like iso_node_remove(), but to be used during a directory iteration. * Like iso_node_remove(), but to be used during a directory iteration.
* The node removed will be the one returned by the previous iteration. * The node removed will be the one returned by the previous iteration.
* *
* It is not allowed to call this function twice without calling * It is not allowed to call this function twice without calling
* iso_dir_iter_next between the calls. * iso_dir_iter_next between the calls.
* *
* @return * @return
* 1 on succes, < 0 error * 1 on success, < 0 error
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if iter is NULL * ISO_NULL_POINTER, if iter is NULL
* ISO_ERROR, on wrong iter usage, for example by calling this before * ISO_ERROR, on wrong iter usage, for example by calling this before
* iso_dir_iter_next. * iso_dir_iter_next.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_dir_iter_remove(IsoDirIter *iter); int iso_dir_iter_remove(IsoDirIter *iter);
/** /**
skipping to change at line 5764 skipping to change at line 5799
* The image object to which the new directory shall belong. * The image object to which the new directory shall belong.
* @param parent * @param parent
* The directory node where the new directory will be grafted in. * The directory node where the new directory will be grafted in.
* @param name * @param name
* Name for the new directory. If truncation mode is set to 1, * Name for the new directory. If truncation mode is set to 1,
* an oversized name gets truncated before further processing. * an oversized name gets truncated before further processing.
* If a node with same name already exists on parent, this function * If a node with same name already exists on parent, this function
* fails with ISO_NODE_NAME_NOT_UNIQUE. * fails with ISO_NODE_NAME_NOT_UNIQUE.
* @param dir * @param dir
* place where to store a pointer to the newly created dir. No extra * place where to store a pointer to the newly created dir. No extra
* ref is addded, so you will need to call iso_node_ref() if you really * ref is added, so you will need to call iso_node_ref() if you really
* need it. You can pass NULL in this parameter if you don't need the * need it. You can pass NULL in this parameter if you don't need the
* pointer. * pointer.
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if parent or name are NULL * ISO_NULL_POINTER, if parent or name are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 5825 skipping to change at line 5860
* Name for the new file. If truncation mode is set to 1, * Name for the new file. If truncation mode is set to 1,
* an oversized name gets truncated before further processing. * an oversized name gets truncated before further processing.
* If a node with same name already exists on parent, this function * If a node with same name already exists on parent, this function
* fails with ISO_NODE_NAME_NOT_UNIQUE. * fails with ISO_NODE_NAME_NOT_UNIQUE.
* @param stream * @param stream
* IsoStream for the contents of the file. The reference will be taken * IsoStream for the contents of the file. The reference will be taken
* by the newly created file, you will need to take an extra ref to it * by the newly created file, you will need to take an extra ref to it
* if you need it. * if you need it.
* @param file * @param file
* place where to store a pointer to the newly created file. No extra * place where to store a pointer to the newly created file. No extra
* ref is addded, so you will need to call iso_node_ref() if you really * ref is added, so you will need to call iso_node_ref() if you really
* need it. You can pass NULL in this parameter if you don't need the * need it. You can pass NULL in this parameter if you don't need the
* pointer * pointer
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if parent, name or dest are NULL * ISO_NULL_POINTER, if parent, name or dest are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 5906 skipping to change at line 5941
* @param name * @param name
* Name for the new symlink. If truncation mode is set to 1, * Name for the new symlink. If truncation mode is set to 1,
* an oversized name gets truncated before further processing. * an oversized name gets truncated before further processing.
* If a node with same name already exists on parent, this function * If a node with same name already exists on parent, this function
* fails with ISO_NODE_NAME_NOT_UNIQUE. * fails with ISO_NODE_NAME_NOT_UNIQUE.
* @param dest * @param dest
* The destination path of the link. The components of this path are * The destination path of the link. The components of this path are
* not checked for being oversized. * not checked for being oversized.
* @param link * @param link
* Place where to store a pointer to the newly created link. No extra * Place where to store a pointer to the newly created link. No extra
* ref is addded, so you will need to call iso_node_ref() if you really * ref is added, so you will need to call iso_node_ref() if you really
* need it. You can pass NULL in this parameter if you don't need the * need it. You can pass NULL in this parameter if you don't need the
* pointer * pointer
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if parent, name or dest are NULL * ISO_NULL_POINTER, if parent, name or dest are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 5956 skipping to change at line 5991
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_tree_add_new_symlink(IsoDir *parent, const char *name, int iso_tree_add_new_symlink(IsoDir *parent, const char *name,
const char *dest, IsoSymlink **link); const char *dest, IsoSymlink **link);
/** /**
* Add a new special file to the directory tree. As far as libisofs concerns, * Add a new special file to the directory tree. As far as libisofs concerns,
* a special file is a block device, a character device, a FIFO (named pipe) * a special file is a block device, a character device, a FIFO (named pipe)
* or a socket. You can choose the specific kind of file you want to add * or a socket. You can choose the specific kind of file you want to add
* by setting mode propertly (see man 2 stat). * by setting mode properly (see man 2 stat).
* *
* Note that special files are only written to image when Rock Ridge * Note that special files are only written to image when Rock Ridge
* extensions are enabled. Moreover, a special file is just a directory entry * extensions are enabled. Moreover, a special file is just a directory entry
* in the image tree, no data is written beyond that. * in the image tree, no data is written beyond that.
* *
* Owner and hidden atts are taken from parent. You can modify any of them * Owner and hidden atts are taken from parent. You can modify any of them
* later. * later.
* *
* @param image * @param image
* The image object to which the new special file shall belong. * The image object to which the new special file shall belong.
skipping to change at line 5982 skipping to change at line 6017
* If a node with same name already exists on parent, this function * If a node with same name already exists on parent, this function
* fails with ISO_NODE_NAME_NOT_UNIQUE. * fails with ISO_NODE_NAME_NOT_UNIQUE.
* @param mode * @param mode
* File type and permissions for the new node. Note that only the file * File type and permissions for the new node. Note that only the file
* types S_IFSOCK, S_IFBLK, S_IFCHR, and S_IFIFO are allowed. * types S_IFSOCK, S_IFBLK, S_IFCHR, and S_IFIFO are allowed.
* S_IFLNK, S_IFREG, or S_IFDIR are not. * S_IFLNK, S_IFREG, or S_IFDIR are not.
* @param dev * @param dev
* Device ID, equivalent to the st_rdev field in man 2 stat. * Device ID, equivalent to the st_rdev field in man 2 stat.
* @param special * @param special
* Place where to store a pointer to the newly created special file. No * Place where to store a pointer to the newly created special file. No
* extra ref is addded, so you will need to call iso_node_ref() if you * extra ref is added, so you will need to call iso_node_ref() if you
* really need it. You can pass NULL in this parameter if you don't need * really need it. You can pass NULL in this parameter if you don't need
* the pointer. * the pointer.
* @return * @return
* Number of nodes in parent if success, < 0 otherwise * Number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if parent, name or dest are NULL * ISO_NULL_POINTER, if parent, name or dest are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_WRONG_ARG_VALUE if you select a incorrect mode * ISO_WRONG_ARG_VALUE if you select a incorrect mode
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
skipping to change at line 6123 skipping to change at line 6158
* Add a excluded path. These are paths that won't never added to image, and * Add a excluded path. These are paths that won't never added to image, and
* will be excluded even when adding recursively its parent directory. * will be excluded even when adding recursively its parent directory.
* *
* For example, in * For example, in
* *
* iso_tree_add_exclude(image, "/home/user/data/private"); * iso_tree_add_exclude(image, "/home/user/data/private");
* iso_tree_add_dir_rec(image, root, "/home/user/data"); * iso_tree_add_dir_rec(image, root, "/home/user/data");
* *
* the directory /home/user/data/private won't be added to image. * the directory /home/user/data/private won't be added to image.
* *
* However, if you explicity add a deeper dir, it won't be excluded. i.e., * However, if you explicitly add a deeper dir, it won't be excluded. i.e.,
* in the following example. * in the following example.
* *
* iso_tree_add_exclude(image, "/home/user/data"); * iso_tree_add_exclude(image, "/home/user/data");
* iso_tree_add_dir_rec(image, root, "/home/user/data/private"); * iso_tree_add_dir_rec(image, root, "/home/user/data/private");
* *
* the directory /home/user/data/private is added. On the other, side, and * the directory /home/user/data/private is added. On the other, side, and
* following the example above, * following the example above,
* *
* iso_tree_add_dir_rec(image, root, "/home/user"); * iso_tree_add_dir_rec(image, root, "/home/user");
* *
skipping to change at line 6214 skipping to change at line 6249
* The image * The image
* @param parent * @param parent
* The directory in the image tree where the node will be added. * The directory in the image tree where the node will be added.
* @param path * @param path
* The absolute path of the file in the local filesystem. * The absolute path of the file in the local filesystem.
* The node will have the same leaf name as the file on disk, possibly * The node will have the same leaf name as the file on disk, possibly
* truncated according to iso_image_set_truncate_mode(). * truncated according to iso_image_set_truncate_mode().
* Its directory path depends on the parent node. * Its directory path depends on the parent node.
* @param node * @param node
* place where to store a pointer to the newly added file. No * place where to store a pointer to the newly added file. No
* extra ref is addded, so you will need to call iso_node_ref() if you * extra ref is added, so you will need to call iso_node_ref() if you
* really need it. You can pass NULL in this parameter if you don't need * really need it. You can pass NULL in this parameter if you don't need
* the pointer. * the pointer.
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if image, parent or path are NULL * ISO_NULL_POINTER, if image, parent or path are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 6249 skipping to change at line 6284
* @param parent * @param parent
* The directory in the image tree where the node will be added. * The directory in the image tree where the node will be added.
* @param name * @param name
* The leaf name that the node will have on image, possibly truncated * The leaf name that the node will have on image, possibly truncated
* according to iso_image_set_truncate_mode(). * according to iso_image_set_truncate_mode().
* Its directory path depends on the parent node. * Its directory path depends on the parent node.
* @param path * @param path
* The absolute path of the file in the local filesystem. * The absolute path of the file in the local filesystem.
* @param node * @param node
* place where to store a pointer to the newly added file. No * place where to store a pointer to the newly added file. No
* extra ref is addded, so you will need to call iso_node_ref() if you * extra ref is added, so you will need to call iso_node_ref() if you
* really need it. You can pass NULL in this parameter if you don't need * really need it. You can pass NULL in this parameter if you don't need
* the pointer. * the pointer.
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if image, parent or path are NULL * ISO_NULL_POINTER, if image, parent or path are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 6288 skipping to change at line 6323
* @param path * @param path
* The absolute path of the file in the local filesystem. For now * The absolute path of the file in the local filesystem. For now
* only regular files and symlinks to regular files are supported. * only regular files and symlinks to regular files are supported.
* @param offset * @param offset
* Byte number in the given file from where to start reading data. * Byte number in the given file from where to start reading data.
* @param size * @param size
* Max size of the file. This may be more than actually available from * Max size of the file. This may be more than actually available from
* byte offset to the end of the file in the local filesystem. * byte offset to the end of the file in the local filesystem.
* @param node * @param node
* place where to store a pointer to the newly added file. No * place where to store a pointer to the newly added file. No
* extra ref is addded, so you will need to call iso_node_ref() if you * extra ref is added, so you will need to call iso_node_ref() if you
* really need it. You can pass NULL in this parameter if you don't need * really need it. You can pass NULL in this parameter if you don't need
* the pointer. * the pointer.
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* Possible errors: * Possible errors:
* ISO_NULL_POINTER, if image, parent or path are NULL * ISO_NULL_POINTER, if image, parent or path are NULL
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists * ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_RR_NAME_TOO_LONG * ISO_RR_NAME_TOO_LONG
* *
skipping to change at line 6417 skipping to change at line 6452
* Path to a dir in the filesystem * Path to a dir in the filesystem
* @return * @return
* number of nodes in parent if success, < 0 otherwise * number of nodes in parent if success, < 0 otherwise
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_tree_add_dir_rec(IsoImage *image, IsoDir *parent, const char *dir); int iso_tree_add_dir_rec(IsoImage *image, IsoDir *parent, const char *dir);
/** /**
* Inquire whether some local filesystem xattr namespace could not be explored * Inquire whether some local filesystem xattr namespace could not be explored
* during node building. This may happen due to lack of adminstrator privileges * during node building.This may happen due to lack of administrator privileges
* e.g. on FreeBSD namespace "system". * e.g. on FreeBSD namespace "system".
* It may well be that the processed local files have no attributes which * It may well be that the processed local files have no attributes which
* would require special privileges. But already their existence was neither * would require special privileges. But already their existence was neither
* denied nor confirmed. * denied nor confirmed.
* *
* @param image * @param image
* The image to inquire. * The image to inquire.
* @param flag * @param flag
* Bitfield for control purposes: * Bitfield for control purposes:
* bit0 = reset internal value to 0 * bit0 = reset internal value to 0
* @return * @return
* 1 = Exploration was prevented * 1 = Exploration was prevented
* 0 = No such prevention occured * 0 = No such prevention occurred
* *
* @since 1.5.0 * @since 1.5.0
*/ */
int iso_image_was_blind_attrs(IsoImage *image, int flag); int iso_image_was_blind_attrs(IsoImage *image, int flag);
/** /**
* Locate a node by its absolute path in the image. * Locate a node by its absolute path in the image.
* The IsoImage context defines a maximum permissible name length and a mode * The IsoImage context defines a maximum permissible name length and a mode
* how to react on oversized names. See iso_image_set_truncate_mode(). * how to react on oversized names. See iso_image_set_truncate_mode().
* *
skipping to change at line 6685 skipping to change at line 6720
* @param severity_name * @param severity_name
* A name as with iso_msgs_submit(), e.g. "SORRY". * A name as with iso_msgs_submit(), e.g. "SORRY".
* *
* @since 0.6.4 * @since 0.6.4
*/ */
int iso_sev_to_text(int severity_number, char **severity_name); int iso_sev_to_text(int severity_number, char **severity_name);
/** /**
* Get the id of an IsoImage, used for message reporting. This message id, * Get the id of an IsoImage, used for message reporting. This message id,
* retrieved with iso_obtain_msgs(), can be used to distinguish what * retrieved with iso_obtain_msgs(), can be used to distinguish what
* IsoImage has isssued a given message. * IsoImage has issued a given message.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_image_get_msg_id(IsoImage *image); int iso_image_get_msg_id(IsoImage *image);
/** /**
* Get a textual description of a libisofs error. * Get a textual description of a libisofs error.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
skipping to change at line 6873 skipping to change at line 6908
* ISO_FILE_DOESNT_EXIST * ISO_FILE_DOESNT_EXIST
* ISO_OUT_OF_MEM * ISO_OUT_OF_MEM
* ISO_FILE_ERROR * ISO_FILE_ERROR
* ISO_NULL_POINTER * ISO_NULL_POINTER
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_file_source_open(IsoFileSource *src); int iso_file_source_open(IsoFileSource *src);
/** /**
* Close a previuously openned file * Close a previously opened file
* @return 1 on success, < 0 on error * @return 1 on success, < 0 on error
* Error codes: * Error codes:
* ISO_FILE_ERROR * ISO_FILE_ERROR
* ISO_NULL_POINTER * ISO_NULL_POINTER
* ISO_FILE_NOT_OPENED * ISO_FILE_NOT_OPENED
* *
* @since 0.6.2 * @since 0.6.2
*/ */
int iso_file_source_close(IsoFileSource *src); int iso_file_source_close(IsoFileSource *src);
skipping to change at line 6929 skipping to change at line 6964
* The given source * The given source
* @param offset * @param offset
* in bytes * in bytes
* @param flag * @param flag
* 0 The offset is set to offset bytes (SEEK_SET) * 0 The offset is set to offset bytes (SEEK_SET)
* 1 The offset is set to its current location plus offset bytes * 1 The offset is set to its current location plus offset bytes
* (SEEK_CUR) * (SEEK_CUR)
* 2 The offset is set to the size of the file plus offset bytes * 2 The offset is set to the size of the file plus offset bytes
* (SEEK_END). * (SEEK_END).
* @return * @return
* Absolute offset posistion on the file, or < 0 on error. Cast the * Absolute offset position on the file, or < 0 on error. Cast the
* returning value to int to get a valid libisofs error. * returning value to int to get a valid libisofs error.
* @since 0.6.4 * @since 0.6.4
*/ */
off_t iso_file_source_lseek(IsoFileSource *src, off_t offset, int flag); off_t iso_file_source_lseek(IsoFileSource *src, off_t offset, int flag);
/** /**
* Read a directory. * Read a directory.
* *
* Each call to this function will return a new child, until we reach * Each call to this function will return a new child, until we reach
* the end of file (i.e, no more children), in that case it returns 0. * the end of file (i.e, no more children), in that case it returns 0.
skipping to change at line 7020 skipping to change at line 7055
* @return 1 means success (*aa_string == NULL is possible) * @return 1 means success (*aa_string == NULL is possible)
* <0 means failure and must b a valid libisofs error code * <0 means failure and must b a valid libisofs error code
* (e.g. ISO_FILE_ERROR if no better one can be found). * (e.g. ISO_FILE_ERROR if no better one can be found).
* @since 0.6.14 * @since 0.6.14
*/ */
int iso_file_source_get_aa_string(IsoFileSource *src, int iso_file_source_get_aa_string(IsoFileSource *src,
unsigned char **aa_string, int flag); unsigned char **aa_string, int flag);
/** /**
* Get the filesystem for this source. No extra ref is added, so you * Get the filesystem for this source. No extra ref is added, so you
* musn't unref the IsoFilesystem. * must not unref the IsoFilesystem.
* *
* @return * @return
* The filesystem, NULL on error * The filesystem, NULL on error
* *
* @since 0.6.2 * @since 0.6.2
*/ */
IsoFilesystem* iso_file_source_get_filesystem(IsoFileSource *src); IsoFilesystem* iso_file_source_get_filesystem(IsoFileSource *src);
/** /**
* Take a ref to the given IsoFilesystem * Take a ref to the given IsoFilesystem
skipping to change at line 7052 skipping to change at line 7087
void iso_filesystem_unref(IsoFilesystem *fs); void iso_filesystem_unref(IsoFilesystem *fs);
/** /**
* Create a new IsoFilesystem to access a existent ISO image. * Create a new IsoFilesystem to access a existent ISO image.
* *
* @param src * @param src
* Data source to access data. * Data source to access data.
* @param opts * @param opts
* Image read options * Image read options
* @param msgid * @param msgid
* An image identifer, obtained with iso_image_get_msg_id(), used to * An image identifier, obtained with iso_image_get_msg_id(), used to
* associated messages issued by the filesystem implementation with an * associated messages issued by the filesystem implementation with an
* existent image. If you are not using this filesystem in relation with * existent image. If you are not using this filesystem in relation with
* any image context, just use 0x1fffff as the value for this parameter. * any image context, just use 0x1fffff as the value for this parameter.
* @param fs * @param fs
* Will be filled with a pointer to the filesystem that can be used * Will be filled with a pointer to the filesystem that can be used
* to access image contents. * to access image contents.
* @return * @return
* 1 on success, < 0 on error * 1 on success, < 0 on error
* *
* @since 0.6.2 * @since 0.6.2
skipping to change at line 7167 skipping to change at line 7202
* *
* @return * @return
* 1 on success, 2 file greater than expected, 3 file smaller than * 1 on success, 2 file greater than expected, 3 file smaller than
* expected, < 0 on error * expected, < 0 on error
* *
* @since 0.6.4 * @since 0.6.4
*/ */
int iso_stream_open(IsoStream *stream); int iso_stream_open(IsoStream *stream);
/** /**
* Close a previously openned IsoStream. * Close a previously opened IsoStream.
* *
* @return * @return
* 1 on success, < 0 on error * 1 on success, < 0 on error
* *
* @since 0.6.4 * @since 0.6.4
*/ */
int iso_stream_close(IsoStream *stream); int iso_stream_close(IsoStream *stream);
/** /**
* Get the size of a given stream. This function should always return the same * Get the size of a given stream. This function should always return the same
skipping to change at line 7387 skipping to change at line 7422
* eventually existing "default" ACL of the node. * eventually existing "default" ACL of the node.
* (GNU/Linux directories can have a "default" ACL which influences * (GNU/Linux directories can have a "default" ACL which influences
* the permissions of newly created files.) * the permissions of newly created files.)
* @param flag * @param flag
* Bitfield for control purposes * Bitfield for control purposes
* bit0= Do not change the stat(2) permissions. * bit0= Do not change the stat(2) permissions.
* Caution: This can make the node's permission set inconsistent. * Caution: This can make the node's permission set inconsistent.
* bit1= Ignore text parameters but rather update the "access" ACL * bit1= Ignore text parameters but rather update the "access" ACL
* to the stat(2) permissions of node. If no "access" ACL exists, * to the stat(2) permissions of node. If no "access" ACL exists,
* then do nothing and return success. * then do nothing and return success.
* bit2= Be verbous about failure causes. * bit2= Be verbose about failure causes.
* @since 1.5.2 * @since 1.5.2
* @return * @return
* > 0 success * > 0 success
* < 0 failure * < 0 failure
* *
* @since 0.6.14 * @since 0.6.14
*/ */
int iso_node_set_acl_text(IsoNode *node, int iso_node_set_acl_text(IsoNode *node,
char *access_text, char *default_text, int flag); char *access_text, char *default_text, int flag);
skipping to change at line 7896 skipping to change at line 7931
* @since 0.6.18 * @since 0.6.18
*/ */
int iso_stream_get_external_filter(IsoStream *stream, int iso_stream_get_external_filter(IsoStream *stream,
IsoExternalFilterCommand **cmd, int flag); IsoExternalFilterCommand **cmd, int flag);
/* ---------------------------- Internal Filters --------------------------- */ /* ---------------------------- Internal Filters --------------------------- */
/** /**
* Install a zisofs filter on top of the content stream of a data file. * Install a zisofs filter on top of the content stream of a data file.
* zisofs is a compression format which is decompressed by some Linux kernels. * zisofs is a compression format which is decompressed by some Linux kernels.
* See also doc/zisofs_format.txt . * See also doc/zisofs_format.txt and doc/zisofs2_format.txt.
* The filter will not be installed if its output size is not smaller than * The filter will not be installed if its output size is not smaller than
* the size of the input stream. * the size of the input stream.
* This is only enabled if the use of libz was enabled at compile time. * This is only enabled if the use of libz was enabled at compile time.
* @param file * @param file
* The data file node which shall show filtered content. * The data file node which shall show filtered content.
* @param flag * @param flag
* Bitfield for control purposes * Bitfield for control purposes
* bit0= Do not install filter if the number of output blocks is * bit0= Do not install filter if the number of output blocks is
* not smaller than the number of input blocks. Block size is 2048. * not smaller than the number of input blocks. Block size is 2048.
* bit1= Install a decompression filter rather than one for compression. * bit1= Install a decompression filter rather than one for compression.
skipping to change at line 7919 skipping to change at line 7954
* bit3= is reserved for internal use and will be forced to 0 * bit3= is reserved for internal use and will be forced to 0
* @return * @return
* 1 on success, 2 if filter available but installation revoked * 1 on success, 2 if filter available but installation revoked
* <0 on error, e.g. ISO_ZLIB_NOT_ENABLED * <0 on error, e.g. ISO_ZLIB_NOT_ENABLED
* *
* @since 0.6.18 * @since 0.6.18
*/ */
int iso_file_add_zisofs_filter(IsoFile *file, int flag); int iso_file_add_zisofs_filter(IsoFile *file, int flag);
/** /**
* Obtain the parameters of a zisofs filter stream.
* @param stream
* The stream to be inquired.
* @param stream_type
* 1=compressing ("ziso")
* -1=uncompressing ("osiz")
* 0 other (any obtained parameters have invalid content)
* @param zisofs_algo
* Algorithm as of ZF field:
* {'p', 'z'} = zisofs version 1 (Zlib)
* {'P', 'Z'} = zisofs version 2 (Zlib)
* @param algo_num
* Algorithm as of zisofs header:
* 0 = zisofs version 1 (Zlib)
* 1 = zisofs version 2 (Zlib)
* @param block_size_log2
* Log2 of the compression block size
* 15 = 32 kiB , 16 = 64 kiB , 17 = 128 kiB, ...
* @param flag
* Bitfield for control purposes, unused yet, submit 0
* @return
* 1 on success, 0 if the stream has not class->type "ziso" or "osiz"
* <0 on error
* @since 1.5.4
*/
int iso_stream_get_zisofs_par(IsoStream *stream, int *stream_type,
uint8_t zisofs_algo[2], uint8_t* algo_num,
int *block_size_log2, int flag);
/**
* Discard the buffered zisofs compression block pointers of a stream, if the
* stream is a zisofs compression stream and not currently opened.
* @param stream
* The stream to be manipulated.
* @param flag
* Bitfield for control purposes, unused yet, submit 0
* @return
* 1 on success, 0 if no block pointers were reoved, <0 on error
* @since 1.5.4
*/
int iso_stream_zisofs_discard_bpt(IsoStream *stream, int flag);
/**
* Discard all buffered zisofs compression block pointers of streams in the
* given image, which are zisofs compression streams and not currently opened.
* @param image
* The image to be manipulated.
* @param flag
* Bitfield for control purposes, unused yet, submit 0
* @return
* ISO_SUCCESS on success, <0 on error
* @since 1.5.4
*/
int iso_image_zisofs_discard_bpt(IsoImage *image, int flag);
/**
* Inquire the number of zisofs compression and uncompression filters which * Inquire the number of zisofs compression and uncompression filters which
* are in use. * are in use.
* @param ziso_count * @param ziso_count
* Will return the number of currently installed compression filters. * Will return the number of currently installed compression filters.
* @param osiz_count * @param osiz_count
* Will return the number of currently installed uncompression filters. * Will return the number of currently installed uncompression filters.
* @param flag * @param flag
* Bitfield for control purposes, unused yet, submit 0 * Bitfield for control purposes, unused yet, submit 0
* @return * @return
* 1 on success, <0 on error * 1 on success, <0 on error
skipping to change at line 7941 skipping to change at line 8032
*/ */
int iso_zisofs_get_refcounts(off_t *ziso_count, off_t *osiz_count, int flag); int iso_zisofs_get_refcounts(off_t *ziso_count, off_t *osiz_count, int flag);
/** /**
* Parameter set for iso_zisofs_set_params(). * Parameter set for iso_zisofs_set_params().
* *
* @since 0.6.18 * @since 0.6.18
*/ */
struct iso_zisofs_ctrl { struct iso_zisofs_ctrl {
/* Set to 0 for this version of the structure */ /* Set to 0 or 1 for this version of the structure
* 0 = only members up to .block_size_log2 are valid
* 1 = members up to .bpt_discard_free_ratio are valid
* @since 1.5.4
*/
int version; int version;
/* Compression level for zlib function compress2(). From <zlib.h>: /* Compression level for zlib function compress2(). From <zlib.h>:
* "between 0 and 9: * "between 0 and 9:
* 1 gives best speed, 9 gives best compression, 0 gives no compression" * 1 gives best speed, 9 gives best compression, 0 gives no compression"
* Default is 6. * Default is 6.
*/ */
int compression_level; int compression_level;
/* Log2 of the block size for compression filters. Allowed values are: /* Log2 of the block size for compression filters of zisofs version 1.
* Allowed values are:
* 15 = 32 kiB , 16 = 64 kiB , 17 = 128 kiB * 15 = 32 kiB , 16 = 64 kiB , 17 = 128 kiB
*/ */
uint8_t block_size_log2; uint8_t block_size_log2;
/* ------------------- Only valid with .version >= 1 ------------------- */
/*
* Whether to produce zisofs2 (zisofs version 2) file headers and ZF
* entries for files which get compressed:
* 0 = do not produce zisofs2,
* do not recognize zisofs2 file headers by magic
* This is the default.
* 1 = zisofs2 is enabled for file size 4 GiB or more
* 2 = zisofs2 shall be used if zisofs is used at all
* @since 1.5.4
*/
int v2_enabled;
/*
* Log2 of block size for zisofs2 files. 0 keeps current setting.
* Allowed are 15 = 32 kiB to 20 = 1024 kiB.
* @since 1.5.4
*/
uint8_t v2_block_size_log2;
/*
* Maximum overall number of blocklist pointers. 0 keeps current setting.
* @since 1.5.4
*/
uint64_t max_total_blocks;
/*
* Ignored as input value: Number of allocated zisofs block pointers.
* @since 1.5.4
*/
uint64_t current_total_blocks;
/*
* Maximum number of blocklist pointers per file. 0 keeps current setting.
* @since 1.5.4
*/
uint64_t max_file_blocks;
/*
* Number of block pointers of a file, which is considered low enough to
* justify a reduction of block size. If this number is > 0, then the
* lowest permissible block size is used, with which not more than the
* given number of block pointers gets produced. Upper limit is the
* setting of block size log2.
* The inavoidable end block pointer counts. E.g. a file of 55 KiB has
* 3 blocks pointers with block size log2 15, and 2 blocks pointers with
* block size log2 16.
* -1 disables this automatic block size adjustment.
* 0 keeps the current setting.
* @since 1.5.4
*/
int64_t block_number_target;
/*
* The number of blocks from which on the block pointer list shall be
* discarded on iso_stream_close() of a compressing stream. This means that
* the pointers have to be determined again on next ziso_stream_compress(),
* so that adding a zisofs compression filter and writing the compressed
* stream needs in the sum three read runs of the input stream.
* 0 keeps the current setting.
* < 0 disables this file size based discarding.
* @since 1.5.4
*/
int64_t bpt_discard_file_blocks;
/*
* A ratio describing the part of max_file_blocks which shall be kept free
* by intermediate discarding of block pointers.
* See above bpt_discard_file_blocks .
* It makes sense to set this to 1.0 if max_file_blocks is substantially
* smaller than max_total_blocks.
* 0.0 keeps the current setting.
* < 0.0 disables this memory consumption based discarding.
* @since 1.5.4
*/
double bpt_discard_free_ratio;
}; };
/** /**
* Set the global parameters for zisofs filtering. * Set the global parameters for zisofs filtering.
* This is only allowed while no zisofs compression filters are installed. * This is only allowed while no zisofs compression filters are installed.
* i.e. ziso_count returned by iso_zisofs_get_refcounts() has to be 0. * i.e. ziso_count returned by iso_zisofs_get_refcounts() has to be 0.
* @param params * @param params
* Pointer to a structure with the intended settings. * Pointer to a structure with the intended settings.
* The caller sets params->version to indicate which set of members
* has been filled. I.e. params->version == 0 causes all members after
* params->block_size_log2 to be ignored.
* @param flag * @param flag
* Bitfield for control purposes, unused yet, submit 0 * Bitfield for control purposes, unused yet, submit 0
* @return * @return
* 1 on success, <0 on error * 1 on success, <0 on error
* *
* @since 0.6.18 * @since 0.6.18
*/ */
int iso_zisofs_set_params(struct iso_zisofs_ctrl *params, int flag); int iso_zisofs_set_params(struct iso_zisofs_ctrl *params, int flag);
/** /**
* Get the current global parameters for zisofs filtering. * Get the current global parameters for zisofs filtering.
* @param params * @param params
* Pointer to a caller provided structure which shall take the settings. * Pointer to a caller provided structure which shall take the settings.
* The caller sets params->version to indicate which set of members
* shall be filled. I.e. params->version == 0 leaves all members after
* params->block_size_log2 untouched.
* @param flag * @param flag
* Bitfield for control purposes, unused yet, submit 0 * Bitfield for control purposes, unused yet, submit 0
* @return * @return
* 1 on success, <0 on error * 1 on success, <0 on error
* *
* @since 0.6.18 * @since 0.6.18
*/ */
int iso_zisofs_get_params(struct iso_zisofs_ctrl *params, int flag); int iso_zisofs_get_params(struct iso_zisofs_ctrl *params, int flag);
/** /**
* Enable or disable the production of "Z2" SUSP entries instead of "ZF"
* entries for zisofs2 compressed files.
* "ZF" with zisofs2 causes unaware Linux kernels to complain like:
* isofs: Unknown ZF compression algorithm: PZ
* "Z2" is silently ignored by unaware Linux kernels.
* @param enable
* 1 = produce "Z2" , 0 = only "ZF" , -1 = do not change
* @return
* 1 = enabled , 0 = not enabled
* @since 1.5.4
*/
int iso_zisofs_ctrl_susp_z2(int enable);
/**
* Check for the given node or for its subtree whether the data file content * Check for the given node or for its subtree whether the data file content
* effectively bears zisofs file headers and eventually mark the outcome * effectively bears zisofs file headers and eventually mark the outcome
* by an xinfo data record if not already marked by a zisofs compressor filter. * by an xinfo data record if not already marked by a zisofs compressor filter.
* This does not install any filter but only a hint for image generation * This does not install any filter but only a hint for image generation
* that the already compressed files shall get written with zisofs ZF entries. * that the already compressed files shall get written with zisofs ZF entries.
* Use this if you insert the compressed reults of program mkzftree from disk * Use this if you insert the compressed results of program mkzftree from disk
* into the image. * into the image.
* @param node * @param node
* The node which shall be checked and eventually marked. * The node which shall be checked and, if appropriate, be marked.
* @param flag * @param flag
* Bitfield for control purposes, unused yet, submit 0 * Bitfield for control purposes
* bit0= prepare for a run with iso_write_opts_set_appendable(,1). * bit0= prepare for a run with iso_write_opts_set_appendable(,1).
* Take into account that files from the imported image * Take into account that files from the imported image
* do not get their content filtered. * do not get their content filtered.
* bit1= permission to overwrite existing zisofs_zf_info * bit1= permission to overwrite existing zisofs_zf_info
* bit2= if no zisofs header is found: * bit2= if no zisofs header is found:
* create xinfo with parameters which indicate no zisofs * create xinfo with parameters which indicate no zisofs
* bit3= no tree recursion if node is a directory * bit3= no tree recursion if node is a directory
* bit4= skip files which stem from the imported image * bit4= skip files which stem from the imported image
* bit8-bit15= maximum zisofs version to be recognized (0 means 1)
* @return * @return
* 0= no zisofs data found * 0= no zisofs data found
* 1= zf xinfo added * 1= zf xinfo added
* 2= found existing zf xinfo and flag bit1 was not set * 2= found existing zf xinfo and flag bit1 was not set
* 3= both encountered: 1 and 2 * 3= both encountered: 1 and 2
* <0 means error * <0 means error
* *
* @since 0.6.18 * @since 0.6.18
*/ */
int iso_node_zf_by_magic(IsoNode *node, int flag); int iso_node_zf_by_magic(IsoNode *node, int flag);
skipping to change at line 8065 skipping to change at line 8260
int iso_gzip_get_refcounts(off_t *gzip_count, off_t *gunzip_count, int flag); int iso_gzip_get_refcounts(off_t *gzip_count, off_t *gunzip_count, int flag);
/* ---------------------------- MD5 Checksums --------------------------- */ /* ---------------------------- MD5 Checksums --------------------------- */
/* Production and loading of MD5 checksums is controlled by calls /* Production and loading of MD5 checksums is controlled by calls
iso_write_opts_set_record_md5() and iso_read_opts_set_no_md5(). iso_write_opts_set_record_md5() and iso_read_opts_set_no_md5().
For data representation details see doc/checksums.txt . For data representation details see doc/checksums.txt .
*/ */
/** /**
* Eventually obtain the recorded MD5 checksum of the session which was * Obtain the recorded MD5 checksum of the session which was
* loaded as ISO image. Such a checksum may be stored together with others * 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 * 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. * covers the data blocks from address start_lba to address end_lba - 1.
* It does not cover the recorded array of md5 checksums. * It does not cover the recorded array of md5 checksums.
* Layout, size, and position of the checksum array is recorded in the xattr * Layout, size, and position of the checksum array is recorded in the xattr
* "isofs.ca" of the session root node. * "isofs.ca" of the session root node.
* @param image * @param image
* The image to inquire * The image to inquire
* @param start_lba * @param start_lba
* Eventually returns the first block address covered by md5 * Returns the first block address covered by md5
* @param end_lba * @param end_lba
* Eventually returns the first block address not covered by md5 any more * Returns the first block address not covered by md5 any more
* @param md5 * @param md5
* Eventually returns 16 byte of MD5 checksum * Returns 16 byte of MD5 checksum
* @param flag * @param flag
* Bitfield for control purposes, unused yet, submit 0 * Bitfield for control purposes, unused yet, submit 0
* @return * @return
* 1= md5 found , 0= no md5 available , <0 indicates error * 1= md5 found
* 0= no md5 available (i.e. start_lba, end_lba, md5 are invalid)
* <0 indicates error
* *
* @since 0.6.22 * @since 0.6.22
*/ */
int iso_image_get_session_md5(IsoImage *image, uint32_t *start_lba, int iso_image_get_session_md5(IsoImage *image, uint32_t *start_lba,
uint32_t *end_lba, char md5[16], int flag); uint32_t *end_lba, char md5[16], int flag);
/** /**
* Eventually obtain the recorded MD5 checksum of a data file from the loaded * Eventually obtain the recorded MD5 checksum of a data file from the loaded
* ISO image. Such a checksum may be stored with others in a contiguous * ISO image. Such a checksum may be stored with others in a contiguous
* array at the end of the loaded session. The data file eventually has an * array at the end of the loaded session. The data file eventually has an
skipping to change at line 8147 skipping to change at line 8344
* without loading the image tree. * without loading the image tree.
* One may start reading and computing MD5 at the suspected image session * One may start reading and computing MD5 at the suspected image session
* start and look out for a session tag on the fly. See doc/checksum.txt . * start and look out for a session tag on the fly. See doc/checksum.txt .
* @param data * @param data
* A complete and aligned data block read from an ISO image session. * A complete and aligned data block read from an ISO image session.
* @param tag_type * @param tag_type
* 0= no tag * 0= no tag
* 1= session tag * 1= session tag
* 2= superblock tag * 2= superblock tag
* 3= tree tag * 3= tree tag
* 4= relocated 64 kB superblock tag (at LBA 0 of overwriteable media) * 4= relocated 64 kB superblock tag (at LBA 0 of overwritable media)
* @param pos * @param pos
* Returns the LBA where the tag supposes itself to be stored. * Returns the LBA where the tag supposes itself to be stored.
* If this does not match the data block LBA then the tag might be * If this does not match the data block LBA then the tag might be
* image data payload and should be ignored for image checksumming. * image data payload and should be ignored for image checksumming.
* @param range_start * @param range_start
* Returns the block address where the session is supposed to start. * Returns the block address where the session is supposed to start.
* If this does not match the session start on media then the image * If this does not match the session start on media then the image
* volume descriptors have been been relocated. * volume descriptors have been been relocated.
* A proper checksum will only emerge if computing started at range_start. * A proper checksum will only emerge if computing started at range_start.
* @param range_size * @param range_size
skipping to change at line 8547 skipping to change at line 8744
/** Access to file is not allowed (FAILURE,HIGH, -130) */ /** Access to file is not allowed (FAILURE,HIGH, -130) */
#define ISO_FILE_ACCESS_DENIED 0xE830FF7E #define ISO_FILE_ACCESS_DENIED 0xE830FF7E
/** Incorrect path to file (FAILURE,HIGH, -131) */ /** Incorrect path to file (FAILURE,HIGH, -131) */
#define ISO_FILE_BAD_PATH 0xE830FF7D #define ISO_FILE_BAD_PATH 0xE830FF7D
/** The file does not exist in the filesystem (FAILURE,HIGH, -132) */ /** The file does not exist in the filesystem (FAILURE,HIGH, -132) */
#define ISO_FILE_DOESNT_EXIST 0xE830FF7C #define ISO_FILE_DOESNT_EXIST 0xE830FF7C
/** Trying to read or close a file not openned (FAILURE,HIGH, -133) */ /** Trying to read or close a file not opened (FAILURE,HIGH, -133) */
#define ISO_FILE_NOT_OPENED 0xE830FF7B #define ISO_FILE_NOT_OPENED 0xE830FF7B
/* @deprecated use ISO_FILE_NOT_OPENED instead */ /* @deprecated use ISO_FILE_NOT_OPENED instead */
#define ISO_FILE_NOT_OPENNED ISO_FILE_NOT_OPENED #define ISO_FILE_NOT_OPENNED ISO_FILE_NOT_OPENED
/** Directory used where no dir is expected (FAILURE,HIGH, -134) */ /** Directory used where no dir is expected (FAILURE,HIGH, -134) */
#define ISO_FILE_IS_DIR 0xE830FF7A #define ISO_FILE_IS_DIR 0xE830FF7A
/** Read error (FAILURE,HIGH, -135) */ /** Read error (FAILURE,HIGH, -135) */
#define ISO_FILE_READ_ERROR 0xE830FF79 #define ISO_FILE_READ_ERROR 0xE830FF79
skipping to change at line 8693 skipping to change at line 8890
(FAILURE, HIGH, -343) */ (FAILURE, HIGH, -343) */
#define ISO_AAIP_NON_USER_NAME 0xE830FEA9 #define ISO_AAIP_NON_USER_NAME 0xE830FEA9
/** Too many references on a single IsoExternalFilterCommand /** Too many references on a single IsoExternalFilterCommand
(FAILURE, HIGH, -344) */ (FAILURE, HIGH, -344) */
#define ISO_EXTF_TOO_OFTEN 0xE830FEA8 #define ISO_EXTF_TOO_OFTEN 0xE830FEA8
/** Use of zlib was not enabled at compile time (FAILURE, HIGH, -345) */ /** Use of zlib was not enabled at compile time (FAILURE, HIGH, -345) */
#define ISO_ZLIB_NOT_ENABLED 0xE830FEA7 #define ISO_ZLIB_NOT_ENABLED 0xE830FEA7
/** Cannot apply zisofs filter to file >= 4 GiB (FAILURE, HIGH, -346) */ /** File too large. Cannot apply zisofs filter. (FAILURE, HIGH, -346) */
#define ISO_ZISOFS_TOO_LARGE 0xE830FEA6 #define ISO_ZISOFS_TOO_LARGE 0xE830FEA6
/** Filter input differs from previous run (FAILURE, HIGH, -347) */ /** Filter input differs from previous run (FAILURE, HIGH, -347) */
#define ISO_FILTER_WRONG_INPUT 0xE830FEA5 #define ISO_FILTER_WRONG_INPUT 0xE830FEA5
/** zlib compression/decompression error (FAILURE, HIGH, -348) */ /** zlib compression/decompression error (FAILURE, HIGH, -348) */
#define ISO_ZLIB_COMPR_ERR 0xE830FEA4 #define ISO_ZLIB_COMPR_ERR 0xE830FEA4
/** Input stream is not in zisofs format (FAILURE, HIGH, -349) */ /** Input stream is not in a supported zisofs format (FAILURE, HIGH, -349) */
#define ISO_ZISOFS_WRONG_INPUT 0xE830FEA3 #define ISO_ZISOFS_WRONG_INPUT 0xE830FEA3
/** Cannot set global zisofs parameters while filters exist /** Cannot set global zisofs parameters while filters exist
(FAILURE, HIGH, -350) */ (FAILURE, HIGH, -350) */
#define ISO_ZISOFS_PARAM_LOCK 0xE830FEA2 #define ISO_ZISOFS_PARAM_LOCK 0xE830FEA2
/** Premature EOF of zlib input stream (FAILURE, HIGH, -351) */ /** Premature EOF of zlib input stream (FAILURE, HIGH, -351) */
#define ISO_ZLIB_EARLY_EOF 0xE830FEA1 #define ISO_ZLIB_EARLY_EOF 0xE830FEA1
/** /**
skipping to change at line 8980 skipping to change at line 9177
(FAILURE, HIGH, -419) */ (FAILURE, HIGH, -419) */
#define ISO_SUSP_WRONG_CE_SIZE 0xE830FE5D #define ISO_SUSP_WRONG_CE_SIZE 0xE830FE5D
/** Multi-session would overwrite imported_iso interval /** Multi-session would overwrite imported_iso interval
(FAILURE, HIGH, -420) */ (FAILURE, HIGH, -420) */
#define ISO_MULTI_OVER_IMPORTED 0xE830FE5C #define ISO_MULTI_OVER_IMPORTED 0xE830FE5C
/** El-Torito EFI image is hidden (NOTE,HIGH, -421) */ /** El-Torito EFI image is hidden (NOTE,HIGH, -421) */
#define ISO_ELTO_EFI_HIDDEN 0xB030FE5B #define ISO_ELTO_EFI_HIDDEN 0xB030FE5B
/** Too many files in HFS+ directory tree (FAILURE, HIGH, -422) */
#define ISO_HFSPLUS_TOO_MANY_FILES 0xE830FE5A
/** Too many zisofs block pointers needed overall (FAILURE, HIGH, -423) */
#define ISO_ZISOFS_TOO_MANY_PTR 0xE830FE59
/** Prevented zisofs block pointer counter underrun (WARNING,MEDIUM, -424) */
#define ISO_ZISOFS_BPT_UNDERRUN 0xD020FE58
/** Cannot obtain size of zisofs compressed stream (FAILURE, HIGH, -425) */
#define ISO_ZISOFS_UNKNOWN_SIZE 0xE830FE57
/* Internal developer note: /* Internal developer note:
Place new error codes directly above this comment. Place new error codes directly above this comment.
Newly introduced errors must get a message entry in Newly introduced errors must get a message entry in
libisofs/messages.c, function iso_error_to_msg() libisofs/messages.c, function iso_error_to_msg()
*/ */
/* ! PLACE NEW ERROR CODES ABOVE. NOT AFTER THIS LINE ! */ /* ! PLACE NEW ERROR CODES ABOVE. NOT AFTER THIS LINE ! */
/** Read error occurred with IsoDataSource (SORRY,HIGH, -513) */ /** Read error occurred with IsoDataSource (SORRY,HIGH, -513) */
#define ISO_DATA_SOURCE_SORRY 0xE030FCFF #define ISO_DATA_SOURCE_SORRY 0xE030FCFF
 End of changes. 76 change blocks. 
67 lines changed or deleted 276 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)