libisofs-0.6.6/libisofs/libisofs.h File Reference

#include <sys/stat.h>
#include <stdint.h>
#include <stdlib.h>

Include dependency graph for libisofs.h:

Go to the source code of this file.

Data Structures

struct  iso_data_source
 Data source used by libisofs for reading an existing image. More...
struct  iso_filesystem
 An IsoFilesystem is a handler for a source of files, or a "filesystem". More...
struct  IsoFileSource_Iface
 Interface definition for an IsoFileSource. More...
struct  iso_file_source
 An IsoFile Source is a POSIX abstraction of a file. More...
struct  IsoStream_Iface
 Interface definition for IsoStream methods. More...
struct  iso_stream
 Representation of file contents as a stream of bytes. More...

Defines

#define ISO_NODE_IS_DIR(n)   (iso_node_get_type(n) == LIBISO_DIR)
#define ISO_NODE_IS_FILE(n)   (iso_node_get_type(n) == LIBISO_FILE)
#define ISO_NODE_IS_SYMLINK(n)   (iso_node_get_type(n) == LIBISO_SYMLINK)
#define ISO_NODE_IS_SPECIAL(n)   (iso_node_get_type(n) == LIBISO_SPECIAL)
#define ISO_NODE_IS_BOOTCAT(n)   (iso_node_get_type(n) == LIBISO_BOOT)
#define ISO_DIR(n)   ((IsoDir*)(ISO_NODE_IS_DIR(n) ? n : NULL))
#define ISO_FILE(n)   ((IsoFile*)(ISO_NODE_IS_FILE(n) ? n : NULL))
#define ISO_SYMLINK(n)   ((IsoSymlink*)(ISO_NODE_IS_SYMLINK(n) ? n : NULL))
#define ISO_SPECIAL(n)   ((IsoSpecial*)(ISO_NODE_IS_SPECIAL(n) ? n : NULL))
#define ISO_NODE(n)   ((IsoNode*)n)
#define iso_lib_header_version_major   0
 These three release version numbers tell the revision of this header file and of the API it describes.
#define iso_lib_header_version_minor   6
#define iso_lib_header_version_micro   6
#define ISO_MSGS_MESSAGE_LEN   4096
#define ISO_SUCCESS   1
 successfully execution
#define ISO_NONE   0
 special return value, it could be or not an error depending on the context.
#define ISO_CANCELED   0xE830FFFF
 Operation canceled (FAILURE,HIGH, -1).
#define ISO_FATAL_ERROR   0xF030FFFE
 Unknown or unexpected fatal error (FATAL,HIGH, -2).
#define ISO_ERROR   0xE830FFFD
 Unknown or unexpected error (FAILURE,HIGH, -3).
#define ISO_ASSERT_FAILURE   0xF030FFFC
 Internal programming error.
#define ISO_NULL_POINTER   0xE830FFFB
 NULL pointer as value for an arg.
#define ISO_OUT_OF_MEM   0xF030FFFA
 Memory allocation error (FATAL,HIGH, -6).
#define ISO_INTERRUPTED   0xF030FFF9
 Interrupted by a signal (FATAL,HIGH, -7).
#define ISO_WRONG_ARG_VALUE   0xE830FFF8
 Invalid parameter value (FAILURE,HIGH, -8).
#define ISO_THREAD_ERROR   0xF030FFF7
 Can't create a needed thread (FATAL,HIGH, -9).
#define ISO_WRITE_ERROR   0xE830FFF6
 Write error (FAILURE,HIGH, -10).
#define ISO_BUF_READ_ERROR   0xE830FFF5
 Buffer read error (FAILURE,HIGH, -11).
#define ISO_NODE_ALREADY_ADDED   0xE830FFC0
 Trying to add to a dir a node already added to a dir (FAILURE,HIGH, -64).
#define ISO_NODE_NAME_NOT_UNIQUE   0xE830FFBF
 Node with same name already exists (FAILURE,HIGH, -65).
#define ISO_NODE_NOT_ADDED_TO_DIR   0xE830FFBE
 Trying to remove a node that was not added to dir (FAILURE,HIGH, -65).
#define ISO_NODE_DOESNT_EXIST   0xE830FFBD
 A requested node does not exist (FAILURE,HIGH, -66).
#define ISO_IMAGE_ALREADY_BOOTABLE   0xE830FFBC
 Try to set the boot image of an already bootable image (FAILURE,HIGH, -67).
#define ISO_BOOT_IMAGE_NOT_VALID   0xE830FFBB
 Trying to use an invalid file as boot image (FAILURE,HIGH, -68).
#define ISO_FILE_ERROR   0xE830FF80
 Error on file operation (FAILURE,HIGH, -128) (take a look at more specified error codes below).
#define ISO_FILE_ALREADY_OPENED   0xE830FF7F
 Trying to open an already openned file (FAILURE,HIGH, -129).
#define ISO_FILE_ALREADY_OPENNED   0xE830FF7F
#define ISO_FILE_ACCESS_DENIED   0xE830FF7E
 Access to file is not allowed (FAILURE,HIGH, -130).
#define ISO_FILE_BAD_PATH   0xE830FF7D
 Incorrect path to file (FAILURE,HIGH, -131).
#define ISO_FILE_DOESNT_EXIST   0xE830FF7C
 The file does not exist in the filesystem (FAILURE,HIGH, -132).
#define ISO_FILE_NOT_OPENED   0xE830FF7B
 Trying to read or close a file not openned (FAILURE,HIGH, -133).
#define ISO_FILE_NOT_OPENNED   ISO_FILE_NOT_OPENED
#define ISO_FILE_IS_DIR   0xE830FF7A
 Directory used where no dir is expected (FAILURE,HIGH, -134).
#define ISO_FILE_READ_ERROR   0xE830FF79
 Read error (FAILURE,HIGH, -135).
#define ISO_FILE_IS_NOT_DIR   0xE830FF78
 Not dir used where a dir is expected (FAILURE,HIGH, -136).
#define ISO_FILE_IS_NOT_SYMLINK   0xE830FF77
 Not symlink used where a symlink is expected (FAILURE,HIGH, -137).
#define ISO_FILE_SEEK_ERROR   0xE830FF76
 Can't seek to specified location (FAILURE,HIGH, -138).
#define ISO_FILE_IGNORED   0xC020FF75
 File not supported in ECMA-119 tree and thus ignored (HINT,MEDIUM, -139).
#define ISO_FILE_TOO_BIG   0xC020FF74
#define ISO_FILE_CANT_WRITE   0xE430FF73
#define ISO_FILENAME_WRONG_CHARSET   0xC020FF72
#define ISO_FILE_CANT_ADD   0xE030FF71
#define ISO_FILE_IMGPATH_WRONG   0xC020FF70
 File path break specification constraints and will be ignored (HINT,MEDIUM, -144).
#define ISO_FILE_OFFSET_TOO_BIG   0xE830FF6A
 Offset greater than file size (FAILURE,HIGH, -145).
#define ISO_CHARSET_CONV_ERROR   0xE830FF00
 Charset conversion error (FAILURE,HIGH, -256).
#define ISO_MANGLE_TOO_MUCH_FILES   0xE830FEFF
 Too much files to mangle, i.e.
#define ISO_WRONG_PVD   0xE830FEC0
 Wrong or damaged Primary Volume Descriptor (FAILURE,HIGH, -320) This could mean that the file is not a valid ISO image.
#define ISO_WRONG_RR   0xE030FEBF
 Wrong or damaged RR entry (SORRY,HIGH, -321).
#define ISO_UNSUPPORTED_RR   0xE030FEBE
 Unsupported RR feature (SORRY,HIGH, -322).
#define ISO_WRONG_ECMA119   0xE830FEBD
 Wrong or damaged ECMA-119 (FAILURE,HIGH, -323).
#define ISO_UNSUPPORTED_ECMA119   0xE830FEBC
 Unsupported ECMA-119 feature (FAILURE,HIGH, -324).
#define ISO_WRONG_EL_TORITO   0xE030FEBB
 Wrong or damaged El-Torito catalog (SORRY,HIGH, -325).
#define ISO_UNSUPPORTED_EL_TORITO   0xE030FEBA
 Unsupported El-Torito feature (SORRY,HIGH, -326).
#define ISO_ISOLINUX_CANT_PATCH   0xE030FEB9
 Can't patch an isolinux boot image (SORRY,HIGH, -327).
#define ISO_UNSUPPORTED_SUSP   0xE030FEB8
 Unsupported SUSP feature (SORRY,HIGH, -328).
#define ISO_WRONG_RR_WARN   0xD030FEB7
 Error on a RR entry that can be ignored (WARNING,HIGH, -329).
#define ISO_SUSP_UNHANDLED   0xC020FEB6
 Error on a RR entry that can be ignored (HINT,MEDIUM, -330).
#define ISO_SUSP_MULTIPLE_ER   0xD030FEB5
 Multiple ER SUSP entries found (WARNING,HIGH, -331).
#define ISO_UNSUPPORTED_VD   0xC020FEB4
 Unsupported volume descriptor found (HINT,MEDIUM, -332).
#define ISO_EL_TORITO_WARN   0xD030FEB3
 El-Torito related warning (WARNING,HIGH, -333).
#define ISO_IMAGE_WRITE_CANCELED   0xE430FEB2
 Image write cancelled (MISHAP,HIGH, -334).
#define ISO_EL_TORITO_HIDDEN   0xD030FEB1
 El-Torito image is hidden (WARNING,HIGH, -335).

Typedefs

typedef struct Iso_Image IsoImage
 Context for image creation.
typedef struct Iso_Node IsoNode
typedef struct Iso_Dir IsoDir
 A directory in the iso tree.
typedef struct Iso_Symlink IsoSymlink
 A symbolic link in the iso tree.
typedef struct Iso_File IsoFile
 A regular file in the iso tree.
typedef struct Iso_Special IsoSpecial
 An special file in the iso tree.
typedef struct Iso_Dir_Iter IsoDirIter
 Context for iterate on directory children.
typedef struct el_torito_boot_image ElToritoBootImage
 It represents an El-Torito boot image.
typedef struct Iso_Boot IsoBoot
 An special type of IsoNode that acts as a placeholder for an El-Torito boot catalog.
typedef struct iso_write_opts IsoWriteOpts
 Options for image written.
typedef struct iso_read_opts IsoReadOpts
 Options for image reading or import.
typedef struct iso_data_source IsoDataSource
 Source for image reading.
typedef struct
iso_read_image_features 
IsoReadImageFeatures
 Return information for image.
typedef struct iso_file_source IsoFileSource
 POSIX abstraction for source files.
typedef struct iso_filesystem IsoFilesystem
 Abstract for source filesystems.
typedef struct IsoFileSource_Iface IsoFileSourceIface
 Interface that defines the operations (methods) available for an IsoFileSource.
typedef IsoFilesystem IsoImageFilesystem
 IsoFilesystem implementation to deal with ISO images, and to offer a way to access specific information of the image, such as several volume attributes, extensions being used, El-Torito artifacts.
typedef struct iso_stream IsoStream
 Representation of file contents.
typedef struct IsoStream_Iface IsoStreamIface
 Interface that defines the operations (methods) available for an IsoStream.
typedef int(* iso_node_xinfo_func )(void *data, int flag)
 Function to handle particular extended information.
typedef struct iso_find_condition IsoFindCondition

Enumerations

enum  IsoNodeType {
  LIBISO_DIR, LIBISO_FILE, LIBISO_SYMLINK, LIBISO_SPECIAL,
  LIBISO_BOOT
}
 The type of an IsoNode. More...
enum  IsoHideNodeFlag { LIBISO_HIDE_ON_RR = 1 << 0, LIBISO_HIDE_ON_JOLIET = 1 << 1, LIBISO_HIDE_ON_1999 = 1 << 2 }
 Flag used to hide a file in the RR/ISO or Joliet tree. More...
enum  eltorito_boot_media_type { ELTORITO_FLOPPY_EMUL, ELTORITO_HARD_DISC_EMUL, ELTORITO_NO_EMUL }
 El-Torito bootable image type. More...
enum  iso_replace_mode {
  ISO_REPLACE_NEVER, ISO_REPLACE_ALWAYS, ISO_REPLACE_IF_SAME_TYPE, ISO_REPLACE_IF_SAME_TYPE_AND_NEWER,
  ISO_REPLACE_IF_NEWER
}
 Replace mode used when addding a node to a file. More...
enum  iso_find_comparisons {
  ISO_FIND_COND_GREATER, ISO_FIND_COND_GREATER_OR_EQUAL, ISO_FIND_COND_EQUAL, ISO_FIND_COND_LESS,
  ISO_FIND_COND_LESS_OR_EQUAL
}
 Possible comparison between IsoNode and given conditions. More...

Functions

int iso_init ()
 Initialize libisofs.
void iso_finish ()
 Finalize libisofs.
int iso_image_new (const char *name, IsoImage **image)
 Create a new image, empty.
void iso_lib_version (int *major, int *minor, int *micro)
 The following two functions three macros are utilities to help ensuring version match of application, compile time header, and runtime library.
int iso_lib_is_compatible (int major, int minor, int micro)
 Check at runtime if the library is ABI compatible with the given version.
int iso_write_opts_new (IsoWriteOpts **opts, int profile)
 Usage discussion:.
void iso_write_opts_free (IsoWriteOpts *opts)
 Free an IsoWriteOpts previously allocated with iso_write_opts_new().
int iso_write_opts_set_iso_level (IsoWriteOpts *opts, int level)
 Set the ISO-9960 level to write at.
int iso_write_opts_set_rockridge (IsoWriteOpts *opts, int enable)
 Whether to use or not Rock Ridge extensions.
int iso_write_opts_set_joliet (IsoWriteOpts *opts, int enable)
 Whether to add the non-standard Joliet extension to the image.
int iso_write_opts_set_iso1999 (IsoWriteOpts *opts, int enable)
 Whether to use newer ISO-9660:1999 version.
int iso_write_opts_set_omit_version_numbers (IsoWriteOpts *opts, int omit)
 Omit the version number (";1") at the end of the ISO-9660 identifiers.
int iso_write_opts_set_allow_deep_paths (IsoWriteOpts *opts, int allow)
 Allow ISO-9660 directory hierarchy to be deeper than 8 levels.
int iso_write_opts_set_allow_longer_paths (IsoWriteOpts *opts, int allow)
 Allow path in the ISO-9660 tree to have more than 255 characters.
int iso_write_opts_set_max_37_char_filenames (IsoWriteOpts *opts, int allow)
 Allow a single file or directory hierarchy to have up to 37 characters.
int iso_write_opts_set_no_force_dots (IsoWriteOpts *opts, int no)
 ISO-9660 forces filenames to have a ".", that separates file name from extension.
int iso_write_opts_set_allow_lowercase (IsoWriteOpts *opts, int allow)
 Allow lowercase characters in ISO-9660 filenames.
int iso_write_opts_set_allow_full_ascii (IsoWriteOpts *opts, int allow)
 Allow all ASCII characters to be appear on an ISO-9660 filename.
int iso_write_opts_set_relaxed_vol_atts (IsoWriteOpts *opts, int allow)
 Allow all characters to be part of Volume and Volset identifiers on the Primary Volume Descriptor.
int iso_write_opts_set_joliet_longer_paths (IsoWriteOpts *opts, int allow)
 Allow paths in the Joliet tree to have more than 240 characters.
int iso_write_opts_set_sort_files (IsoWriteOpts *opts, int sort)
 Whether to sort files based on their weight.
int iso_write_opts_set_replace_mode (IsoWriteOpts *opts, int dir_mode, int file_mode, int uid, int gid)
 Whether to set default values for files and directory permissions, gid and uid.
int iso_write_opts_set_default_dir_mode (IsoWriteOpts *opts, mode_t dir_mode)
 Set the mode to use on dirs when you set the replace_mode of dirs to 2.
int iso_write_opts_set_default_file_mode (IsoWriteOpts *opts, mode_t file_mode)
 Set the mode to use on files when you set the replace_mode of files to 2.
int iso_write_opts_set_default_uid (IsoWriteOpts *opts, uid_t uid)
 Set the uid to use when you set the replace_uid to 2.
int iso_write_opts_set_default_gid (IsoWriteOpts *opts, gid_t gid)
 Set the gid to use when you set the replace_gid to 2.
int iso_write_opts_set_replace_timestamps (IsoWriteOpts *opts, int replace)
 0 to use IsoNode timestamps, 1 to use recording time, 2 to use values from timestamp field.
int iso_write_opts_set_default_timestamp (IsoWriteOpts *opts, time_t timestamp)
 Set the timestamp to use when you set the replace_timestamps to 2.
int iso_write_opts_set_always_gmt (IsoWriteOpts *opts, int gmt)
 Whether to always record timestamps in GMT.
int iso_write_opts_set_output_charset (IsoWriteOpts *opts, const char *charset)
 Set the charset to use for the RR names of the files that will be created on the image.
int iso_write_opts_set_appendable (IsoWriteOpts *opts, int appendable)
 Set the type of the image to create.
int iso_write_opts_set_ms_block (IsoWriteOpts *opts, uint32_t ms_block)
 Set the start block of the image.
int iso_write_opts_set_overwrite_buf (IsoWriteOpts *opts, uint8_t *overwrite)
 Sets the buffer where to store the descriptors which shall to be written at the beginning of an overwriteable media to point to the newly written image.
int iso_write_opts_set_fifo_size (IsoWriteOpts *opts, size_t fifo_size)
 Set the size, in number of blocks, of the FIFO buffer used between the writer thread and the burn_source.
int iso_image_create_burn_source (IsoImage *image, IsoWriteOpts *opts, struct burn_source **burn_src)
 Create a burn_source to actually write the image.
int iso_read_opts_new (IsoReadOpts **opts, int profile)
 Creates an IsoReadOpts for reading an existent image.
void iso_read_opts_free (IsoReadOpts *opts)
 Free an IsoReadOpts previously allocated with iso_read_opts_new().
int iso_read_opts_set_start_block (IsoReadOpts *opts, uint32_t block)
 Set the block where the image begins.
int iso_read_opts_set_no_rockridge (IsoReadOpts *opts, int norr)
 Do not read Rock Ridge extensions.
int iso_read_opts_set_no_joliet (IsoReadOpts *opts, int nojoliet)
 Do not read Joliet extensions.
int iso_read_opts_set_no_iso1999 (IsoReadOpts *opts, int noiso1999)
 Do not read ISO 9660:1999 enhanced tree.
int iso_read_opts_set_preferjoliet (IsoReadOpts *opts, int preferjoliet)
 Whether to prefer Joliet over RR.
int iso_read_opts_set_default_uid (IsoReadOpts *opts, uid_t uid)
 Set default uid for files when RR extensions are not present.
int iso_read_opts_set_default_gid (IsoReadOpts *opts, gid_t gid)
 Set default gid for files when RR extensions are not present.
int iso_read_opts_set_default_permissions (IsoReadOpts *opts, mode_t file_perm, mode_t dir_perm)
 Set default permissions for files when RR extensions are not present.
int iso_read_opts_set_input_charset (IsoReadOpts *opts, const char *charset)
 Set the input charset of the file names on the image.
int iso_image_import (IsoImage *image, IsoDataSource *src, IsoReadOpts *opts, IsoReadImageFeatures **features)
 Import a previous session or image, for growing or modify.
void iso_read_image_features_destroy (IsoReadImageFeatures *f)
 Destroy an IsoReadImageFeatures object obtained with iso_image_import.
uint32_t iso_read_image_features_get_size (IsoReadImageFeatures *f)
 Get the size (in 2048 byte block) of the image, as reported in the PVM.
int iso_read_image_features_has_rockridge (IsoReadImageFeatures *f)
 Whether RockRidge extensions are present in the image imported.
int iso_read_image_features_has_joliet (IsoReadImageFeatures *f)
 Whether Joliet extensions are present in the image imported.
int iso_read_image_features_has_iso1999 (IsoReadImageFeatures *f)
 Whether the image is recorded according to ISO 9660:1999, i.e.
int iso_read_image_features_has_eltorito (IsoReadImageFeatures *f)
 Whether El-Torito boot record is present present in the image imported.
void iso_image_ref (IsoImage *image)
 Increments the reference counting of the given image.
void iso_image_unref (IsoImage *image)
 Decrements the reference couting of the given image.
int iso_image_attach_data (IsoImage *image, void *data, void(*give_up)(void *))
 Attach user defined data to the image.
void * iso_image_get_attached_data (IsoImage *image)
 The the data previously attached with iso_image_attach_data().
IsoDiriso_image_get_root (const IsoImage *image)
 Get the root directory of the image.
void iso_image_set_volset_id (IsoImage *image, const char *volset_id)
 Fill in the volset identifier for a image.
const char * iso_image_get_volset_id (const IsoImage *image)
 Get the volset identifier.
void iso_image_set_volume_id (IsoImage *image, const char *volume_id)
 Fill in the volume identifier for a image.
const char * iso_image_get_volume_id (const IsoImage *image)
 Get the volume identifier.
void iso_image_set_publisher_id (IsoImage *image, const char *publisher_id)
 Fill in the publisher for a image.
const char * iso_image_get_publisher_id (const IsoImage *image)
 Get the publisher of a image.
void iso_image_set_data_preparer_id (IsoImage *image, const char *data_preparer_id)
 Fill in the data preparer for a image.
const char * iso_image_get_data_preparer_id (const IsoImage *image)
 Get the data preparer of a image.
void iso_image_set_system_id (IsoImage *image, const char *system_id)
 Fill in the system id for a image.
const char * iso_image_get_system_id (const IsoImage *image)
 Get the system id of a image.
void iso_image_set_application_id (IsoImage *image, const char *application_id)
 Fill in the application id for a image.
const char * iso_image_get_application_id (const IsoImage *image)
 Get the application id of a image.
void iso_image_set_copyright_file_id (IsoImage *image, const char *copyright_file_id)
 Fill copyright information for the image.
const char * iso_image_get_copyright_file_id (const IsoImage *image)
 Get the copyright information of a image.
void iso_image_set_abstract_file_id (IsoImage *image, const char *abstract_file_id)
 Fill abstract information for the image.
const char * iso_image_get_abstract_file_id (const IsoImage *image)
 Get the abstract information of a image.
void iso_image_set_biblio_file_id (IsoImage *image, const char *biblio_file_id)
 Fill biblio information for the image.
const char * iso_image_get_biblio_file_id (const IsoImage *image)
 Get the biblio information of a image.
int iso_image_set_boot_image (IsoImage *image, const char *image_path, enum eltorito_boot_media_type type, const char *catalog_path, ElToritoBootImage **boot)
 Create a bootable image by adding a El-Torito boot image.
int iso_image_get_boot_image (IsoImage *image, ElToritoBootImage **boot, IsoFile **imgnode, IsoBoot **catnode)
 Get El-Torito boot image of an ISO image, if any.
void iso_image_remove_boot_image (IsoImage *image)
 Removes the El-Torito bootable image.
void el_torito_set_load_seg (ElToritoBootImage *bootimg, short segment)
 Sets the load segment for the initial boot image.
void el_torito_set_load_size (ElToritoBootImage *bootimg, short sectors)
 Sets the number of sectors (512b) to be load at load segment during the initial boot procedure.
void el_torito_set_no_bootable (ElToritoBootImage *bootimg)
 Marks the specified boot image as not bootable.
void el_torito_patch_isolinux_image (ElToritoBootImage *bootimg)
 Specifies that this image needs to be patched.
void iso_node_ref (IsoNode *node)
 Increments the reference counting of the given node.
void iso_node_unref (IsoNode *node)
 Decrements the reference couting of the given node.
enum IsoNodeType iso_node_get_type (IsoNode *node)
 Get the type of an IsoNode.
int iso_node_add_xinfo (IsoNode *node, iso_node_xinfo_func proc, void *data)
 Add extended information to the given node.
int iso_node_remove_xinfo (IsoNode *node, iso_node_xinfo_func proc)
 Remove the given extended info (defined by the proc function) from the given node.
int iso_node_get_xinfo (IsoNode *node, iso_node_xinfo_func proc, void **data)
 Get the given extended info (defined by the proc function) from the given node.
int iso_node_set_name (IsoNode *node, const char *name)
 Set the name of a node.
const char * iso_node_get_name (const IsoNode *node)
 Get the name of a node.
void iso_node_set_permissions (IsoNode *node, mode_t mode)
 Set the permissions for the node.
mode_t iso_node_get_permissions (const IsoNode *node)
 Get the permissions for the node.
mode_t iso_node_get_mode (const IsoNode *node)
 Get the mode of the node, both permissions and file type, as specified in 'man 2 stat'.
void iso_node_set_uid (IsoNode *node, uid_t uid)
 Set the user id for the node.
uid_t iso_node_get_uid (const IsoNode *node)
 Get the user id of the node.
void iso_node_set_gid (IsoNode *node, gid_t gid)
 Set the group id for the node.
gid_t iso_node_get_gid (const IsoNode *node)
 Get the group id of the node.
void iso_node_set_mtime (IsoNode *node, time_t time)
 Set the time of last modification of the file.
time_t iso_node_get_mtime (const IsoNode *node)
 Get the time of last modification of the file.
void iso_node_set_atime (IsoNode *node, time_t time)
 Set the time of last access to the file.
time_t iso_node_get_atime (const IsoNode *node)
 Get the time of last access to the file.
void iso_node_set_ctime (IsoNode *node, time_t time)
 Set the time of last status change of the file.
time_t iso_node_get_ctime (const IsoNode *node)
 Get the time of last status change of the file.
void iso_node_set_hidden (IsoNode *node, int hide_attrs)
 Set if the node will be hidden in RR/ISO tree, Joliet tree or both.
int iso_dir_add_node (IsoDir *dir, IsoNode *child, enum iso_replace_mode replace)
 Add a new node to a dir.
int iso_dir_get_node (IsoDir *dir, const char *name, IsoNode **node)
 Locate a node inside a given dir.
int iso_dir_get_children_count (IsoDir *dir)
 Get the number of children of a directory.
int iso_node_take (IsoNode *node)
 Removes a child from a directory.
int iso_node_remove (IsoNode *node)
 Removes a child from a directory and free (unref) it.
IsoDiriso_node_get_parent (IsoNode *node)
int iso_dir_get_children (const IsoDir *dir, IsoDirIter **iter)
 Get an iterator for the children of the given dir.
int iso_dir_iter_next (IsoDirIter *iter, IsoNode **node)
 Get the next child.
int iso_dir_iter_has_next (IsoDirIter *iter)
 Check if there're more children.
void iso_dir_iter_free (IsoDirIter *iter)
 Free a dir iterator.
int iso_dir_iter_take (IsoDirIter *iter)
 Removes a child from a directory during an iteration, without freeing it.
int iso_dir_iter_remove (IsoDirIter *iter)
 Removes a child from a directory during an iteration and unref() it.
IsoFindConditioniso_new_find_conditions_name (const char *wildcard)
 Create a new condition that checks if the node name matches the given wildcard.
IsoFindConditioniso_new_find_conditions_mode (mode_t mask)
 Create a new condition that checks the node mode against a mode mask.
IsoFindConditioniso_new_find_conditions_gid (gid_t gid)
 Create a new condition that checks the node gid.
IsoFindConditioniso_new_find_conditions_uid (uid_t uid)
 Create a new condition that checks the node uid.
IsoFindConditioniso_new_find_conditions_atime (time_t time, enum iso_find_comparisons comparison)
 Create a new condition that checks the time of last access.
IsoFindConditioniso_new_find_conditions_mtime (time_t time, enum iso_find_comparisons comparison)
 Create a new condition that checks the time of last modification.
IsoFindConditioniso_new_find_conditions_ctime (time_t time, enum iso_find_comparisons comparison)
 Create a new condition that checks the time of last status change.
IsoFindConditioniso_new_find_conditions_and (IsoFindCondition *a, IsoFindCondition *b)
 Create a new condition that check if the two given conditions are valid.
IsoFindConditioniso_new_find_conditions_or (IsoFindCondition *a, IsoFindCondition *b)
 Create a new condition that check if at least one the two given conditions is valid.
IsoFindConditioniso_new_find_conditions_not (IsoFindCondition *negate)
 Create a new condition that check if the given conditions is false.
int iso_dir_find_children (IsoDir *dir, IsoFindCondition *cond, IsoDirIter **iter)
 Find all directory children that match the given condition.
const char * iso_symlink_get_dest (const IsoSymlink *link)
 Get the destination of a node.
int iso_symlink_set_dest (IsoSymlink *link, const char *dest)
 Set the destination of a link.
void iso_node_set_sort_weight (IsoNode *node, int w)
 Sets the order in which a node will be written on image.
int iso_file_get_sort_weight (IsoFile *file)
 Get the sort weight of a file.
off_t iso_file_get_size (IsoFile *file)
 Get the size of the file, in bytes.
dev_t iso_special_get_dev (IsoSpecial *special)
 Get the device id (major/minor numbers) of the given block or character device file.
IsoStreamiso_file_get_stream (IsoFile *file)
 Get the IsoStream that represents the contents of the given IsoFile.
int iso_file_get_old_image_lba (IsoFile *file, uint32_t *lba, int flag)
 Get the block lba of a file node, if it was imported from an old image.
int iso_node_get_old_image_lba (IsoNode *node, uint32_t *lba, int flag)
int iso_tree_add_new_dir (IsoDir *parent, const char *name, IsoDir **dir)
 Add a new directory to the iso tree.
int iso_tree_add_new_file (IsoDir *parent, const char *name, IsoStream *stream, IsoFile **file)
 Add a new regular file to the iso tree.
int iso_tree_add_new_symlink (IsoDir *parent, const char *name, const char *dest, IsoSymlink **link)
 Add a new symlink to the directory tree.
int iso_tree_add_new_special (IsoDir *parent, const char *name, mode_t mode, dev_t dev, IsoSpecial **special)
 Add a new special file to the directory tree.
void iso_tree_set_follow_symlinks (IsoImage *image, int follow)
 Set whether to follow or not symbolic links when added a file from a source to IsoImage.
int iso_tree_get_follow_symlinks (IsoImage *image)
 Get current setting for follow_symlinks.
void iso_tree_set_ignore_hidden (IsoImage *image, int skip)
 Set whether to skip or not hidden files when adding a directory recursibely.
int iso_tree_get_ignore_hidden (IsoImage *image)
 Get current setting for ignore_hidden.
void iso_tree_set_replace_mode (IsoImage *image, enum iso_replace_mode mode)
 Set the replace mode, that defines the behavior of libisofs when adding a node whit the same name that an existent one, during a recursive directory addition.
enum iso_replace_mode iso_tree_get_replace_mode (IsoImage *image)
 Get current setting for replace_mode.
void iso_tree_set_ignore_special (IsoImage *image, int skip)
 Set whether to skip or not special files.
int iso_tree_get_ignore_special (IsoImage *image)
 Get current setting for ignore_special.
int iso_tree_add_exclude (IsoImage *image, const char *path)
 Add a excluded path.
int iso_tree_remove_exclude (IsoImage *image, const char *path)
 Remove a previously added exclude.
void iso_tree_set_report_callback (IsoImage *image, int(*report)(IsoImage *, IsoFileSource *))
 Set a callback function that libisofs will call for each file that is added to the given image by a recursive addition function.
int iso_tree_add_node (IsoImage *image, IsoDir *parent, const char *path, IsoNode **node)
 Add a new node to the image tree, from an existing file.
int iso_tree_add_new_node (IsoImage *image, IsoDir *parent, const char *name, const char *path, IsoNode **node)
 Add a new node to the image tree, from an existing file, and with the given name, that must not exist on dir.
int iso_tree_add_new_cut_out_node (IsoImage *image, IsoDir *parent, const char *name, const char *path, off_t offset, off_t size, IsoNode **node)
 Add a new node to the image tree, from an existing file, and with the given name, that must not exist on dir.
int iso_tree_add_dir_rec (IsoImage *image, IsoDir *parent, const char *dir)
 Add the contents of a dir to a given directory of the iso tree.
int iso_tree_path_to_node (IsoImage *image, const char *path, IsoNode **node)
 Locate a node by its path on image.
char * iso_tree_get_node_path (IsoNode *node)
 Get the path on image of the given node.
void iso_data_source_ref (IsoDataSource *src)
 Increments the reference counting of the given IsoDataSource.
void iso_data_source_unref (IsoDataSource *src)
 Decrements the reference counting of the given IsoDataSource, freeing it if refcount reach 0.
int iso_data_source_new_from_file (const char *path, IsoDataSource **src)
 Create a new IsoDataSource from a local file.
int iso_ring_buffer_get_status (struct burn_source *b, size_t *size, size_t *free_bytes)
 Get the status of the buffer used by a burn_source.
int iso_set_msgs_severities (char *queue_severity, char *print_severity, char *print_id)
 Control queueing and stderr printing of messages from libisofs.
int iso_obtain_msgs (char *minimum_severity, int *error_code, int *imgid, char msg_text[], char severity[])
 Obtain the oldest pending libisofs message from the queue which has at least the given minimum_severity.
int iso_msgs_submit (int error_code, char msg_text[], int os_errno, char severity[], int origin)
 Submit a message to the libisofs queueing system.
int iso_text_to_sev (char *severity_name, int *severity_number)
 Convert a severity name into a severity number, which gives the severity rank of the name.
int iso_sev_to_text (int severity_number, char **severity_name)
 Convert a severity number into a severity name.
int iso_image_get_msg_id (IsoImage *image)
 Get the id of an IsoImage, used for message reporting.
const char * iso_error_to_msg (int errcode)
 Get a textual description of a libisofs error.
int iso_error_get_severity (int e)
 Get the severity of a given error code.
int iso_error_get_priority (int e)
 Get the priority of a given error.
int iso_error_get_code (int e)
 Get the message queue code of a libisofs error.
int iso_set_abort_severity (char *severity)
 Set the minimum error severity that causes a libisofs operation to be aborted as soon as possible.
void * iso_get_messenger ()
 Return the messenger object handle used by libisofs.
void iso_file_source_ref (IsoFileSource *src)
 Take a ref to the given IsoFileSource.
void iso_file_source_unref (IsoFileSource *src)
 Drop your ref to the given IsoFileSource, eventually freeing the associated system resources.
char * iso_file_source_get_path (IsoFileSource *src)
 Get the path, relative to the filesystem this file source belongs to.
char * iso_file_source_get_name (IsoFileSource *src)
 Get the name of the file, with the dir component of the path.
int iso_file_source_lstat (IsoFileSource *src, struct stat *info)
 Get information about the file.
int iso_file_source_access (IsoFileSource *src)
 Check if the process has access to read file contents.
int iso_file_source_stat (IsoFileSource *src, struct stat *info)
 Get information about the file.
int iso_file_source_open (IsoFileSource *src)
 Opens the source.
int iso_file_source_close (IsoFileSource *src)
 Close a previuously openned file.
int iso_file_source_read (IsoFileSource *src, void *buf, size_t count)
 Attempts to read up to count bytes from the given source into the buffer starting at buf.
off_t iso_file_source_lseek (IsoFileSource *src, off_t offset, int flag)
 Repositions the offset of the given IsoFileSource (must be opened) to the given offset according to the value of flag.
int iso_file_source_readdir (IsoFileSource *src, IsoFileSource **child)
 Read a directory.
int iso_file_source_readlink (IsoFileSource *src, char *buf, size_t bufsiz)
 Read the destination of a symlink.
IsoFilesystemiso_file_source_get_filesystem (IsoFileSource *src)
 Get the filesystem for this source.
void iso_filesystem_ref (IsoFilesystem *fs)
 Take a ref to the given IsoFilesystem.
void iso_filesystem_unref (IsoFilesystem *fs)
 Drop your ref to the given IsoFilesystem, evetually freeing associated resources.
int iso_image_filesystem_new (IsoDataSource *src, IsoReadOpts *opts, int msgid, IsoImageFilesystem **fs)
 Create a new IsoFilesystem to access a existent ISO image.
const char * iso_image_fs_get_volset_id (IsoImageFilesystem *fs)
 Get the volset identifier for an existent image.
const char * iso_image_fs_get_volume_id (IsoImageFilesystem *fs)
 Get the volume identifier for an existent image.
const char * iso_image_fs_get_publisher_id (IsoImageFilesystem *fs)
 Get the publisher identifier for an existent image.
const char * iso_image_fs_get_data_preparer_id (IsoImageFilesystem *fs)
 Get the data preparer identifier for an existent image.
const char * iso_image_fs_get_system_id (IsoImageFilesystem *fs)
 Get the system identifier for an existent image.
const char * iso_image_fs_get_application_id (IsoImageFilesystem *fs)
 Get the application identifier for an existent image.
const char * iso_image_fs_get_copyright_file_id (IsoImageFilesystem *fs)
 Get the copyright file identifier for an existent image.
const char * iso_image_fs_get_abstract_file_id (IsoImageFilesystem *fs)
 Get the abstract file identifier for an existent image.
const char * iso_image_fs_get_biblio_file_id (IsoImageFilesystem *fs)
 Get the biblio file identifier for an existent image.
void iso_stream_ref (IsoStream *stream)
 Increment reference count of an IsoStream.
void iso_stream_unref (IsoStream *stream)
 Decrement reference count of an IsoStream, and eventually free it if refcount reach 0.
int iso_stream_open (IsoStream *stream)
 Opens the given stream.
int iso_stream_close (IsoStream *stream)
 Close a previously openned IsoStream.
off_t iso_stream_get_size (IsoStream *stream)
 Get the size of a given stream.
int iso_stream_read (IsoStream *stream, void *buf, size_t count)
 Attempts to read up to count bytes from the given stream into the buffer starting at buf.
int iso_stream_is_repeatable (IsoStream *stream)
 Whether the given IsoStream can be read several times, with the same results.
void iso_stream_get_id (IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id)
 Get an unique identifier for a given IsoStream.

Variables

unsigned int iso_fs_global_id
 See IsoFilesystem->get_id() for info about this.
ino_t serial_id
 Serial number to be used when you can't get a valid id for a Stream by other means.


Define Documentation

#define ISO_ASSERT_FAILURE   0xF030FFFC

Internal programming error.

Please report this bug (FATAL,HIGH, -4)

Definition at line 3683 of file libisofs.h.

#define ISO_BOOT_IMAGE_NOT_VALID   0xE830FFBB

Trying to use an invalid file as boot image (FAILURE,HIGH, -68).

Definition at line 3726 of file libisofs.h.

#define ISO_BUF_READ_ERROR   0xE830FFF5

Buffer read error (FAILURE,HIGH, -11).

Definition at line 3706 of file libisofs.h.

#define ISO_CANCELED   0xE830FFFF

Operation canceled (FAILURE,HIGH, -1).

Definition at line 3674 of file libisofs.h.

#define ISO_CHARSET_CONV_ERROR   0xE830FF00

Charset conversion error (FAILURE,HIGH, -256).

Definition at line 3798 of file libisofs.h.

#define ISO_DIR (  )     ((IsoDir*)(ISO_NODE_IS_DIR(n) ? n : NULL))

Definition at line 103 of file libisofs.h.

#define ISO_EL_TORITO_HIDDEN   0xD030FEB1

El-Torito image is hidden (WARNING,HIGH, -335).

Definition at line 3857 of file libisofs.h.

#define ISO_EL_TORITO_WARN   0xD030FEB3

El-Torito related warning (WARNING,HIGH, -333).

Definition at line 3851 of file libisofs.h.

#define ISO_ERROR   0xE830FFFD

Unknown or unexpected error (FAILURE,HIGH, -3).

Definition at line 3680 of file libisofs.h.

#define ISO_FATAL_ERROR   0xF030FFFE

Unknown or unexpected fatal error (FATAL,HIGH, -2).

Definition at line 3677 of file libisofs.h.

#define ISO_FILE (  )     ((IsoFile*)(ISO_NODE_IS_FILE(n) ? n : NULL))

Definition at line 104 of file libisofs.h.

#define ISO_FILE_ACCESS_DENIED   0xE830FF7E

Access to file is not allowed (FAILURE,HIGH, -130).

Definition at line 3741 of file libisofs.h.

#define ISO_FILE_ALREADY_OPENED   0xE830FF7F

Trying to open an already openned file (FAILURE,HIGH, -129).

Definition at line 3735 of file libisofs.h.

#define ISO_FILE_ALREADY_OPENNED   0xE830FF7F

Definition at line 3738 of file libisofs.h.

#define ISO_FILE_BAD_PATH   0xE830FF7D

Incorrect path to file (FAILURE,HIGH, -131).

Definition at line 3744 of file libisofs.h.

#define ISO_FILE_CANT_ADD   0xE030FF71

Definition at line 3783 of file libisofs.h.

#define ISO_FILE_CANT_WRITE   0xE430FF73

Definition at line 3777 of file libisofs.h.

#define ISO_FILE_DOESNT_EXIST   0xE830FF7C

The file does not exist in the filesystem (FAILURE,HIGH, -132).

Definition at line 3747 of file libisofs.h.

#define ISO_FILE_ERROR   0xE830FF80

Error on file operation (FAILURE,HIGH, -128) (take a look at more specified error codes below).

Definition at line 3732 of file libisofs.h.

#define ISO_FILE_IGNORED   0xC020FF75

File not supported in ECMA-119 tree and thus ignored (HINT,MEDIUM, -139).

Definition at line 3771 of file libisofs.h.

#define ISO_FILE_IMGPATH_WRONG   0xC020FF70

File path break specification constraints and will be ignored (HINT,MEDIUM, -144).

Definition at line 3789 of file libisofs.h.

#define ISO_FILE_IS_DIR   0xE830FF7A

Directory used where no dir is expected (FAILURE,HIGH, -134).

Definition at line 3756 of file libisofs.h.

#define ISO_FILE_IS_NOT_DIR   0xE830FF78

Not dir used where a dir is expected (FAILURE,HIGH, -136).

Definition at line 3762 of file libisofs.h.

#define ISO_FILE_IS_NOT_SYMLINK   0xE830FF77

Not symlink used where a symlink is expected (FAILURE,HIGH, -137).

Definition at line 3765 of file libisofs.h.

#define ISO_FILE_NOT_OPENED   0xE830FF7B

Trying to read or close a file not openned (FAILURE,HIGH, -133).

Definition at line 3750 of file libisofs.h.

#define ISO_FILE_NOT_OPENNED   ISO_FILE_NOT_OPENED

Definition at line 3753 of file libisofs.h.

#define ISO_FILE_OFFSET_TOO_BIG   0xE830FF6A

Offset greater than file size (FAILURE,HIGH, -145).

Since:
0.6.4

Definition at line 3795 of file libisofs.h.

#define ISO_FILE_READ_ERROR   0xE830FF79

Read error (FAILURE,HIGH, -135).

Definition at line 3759 of file libisofs.h.

#define ISO_FILE_SEEK_ERROR   0xE830FF76

Can't seek to specified location (FAILURE,HIGH, -138).

Definition at line 3768 of file libisofs.h.

#define ISO_FILE_TOO_BIG   0xC020FF74

Definition at line 3774 of file libisofs.h.

#define ISO_FILENAME_WRONG_CHARSET   0xC020FF72

Definition at line 3780 of file libisofs.h.

#define ISO_IMAGE_ALREADY_BOOTABLE   0xE830FFBC

Try to set the boot image of an already bootable image (FAILURE,HIGH, -67).

Definition at line 3723 of file libisofs.h.

#define ISO_IMAGE_WRITE_CANCELED   0xE430FEB2

Image write cancelled (MISHAP,HIGH, -334).

Definition at line 3854 of file libisofs.h.

#define ISO_INTERRUPTED   0xF030FFF9

Interrupted by a signal (FATAL,HIGH, -7).

Definition at line 3694 of file libisofs.h.

#define ISO_ISOLINUX_CANT_PATCH   0xE030FEB9

Can't patch an isolinux boot image (SORRY,HIGH, -327).

Definition at line 3833 of file libisofs.h.

#define iso_lib_header_version_major   0

These three release version numbers tell the revision of this header file and of the API it describes.

They are memorized by applications at compile time. They must show the same values as these symbols in ./configure.ac LIBISOFS_MAJOR_VERSION=... LIBISOFS_MINOR_VERSION=... LIBISOFS_MICRO_VERSION=... Note to anybody who does own work inside libisofs: 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 below.

Since:
0.6.2

Definition at line 851 of file libisofs.h.

#define iso_lib_header_version_micro   6

Definition at line 853 of file libisofs.h.

#define iso_lib_header_version_minor   6

Definition at line 852 of file libisofs.h.

#define ISO_MANGLE_TOO_MUCH_FILES   0xE830FEFF

Too much files to mangle, i.e.

we cannot guarantee unique file names (FAILURE,HIGH, -257)

Definition at line 3804 of file libisofs.h.

#define ISO_MSGS_MESSAGE_LEN   4096

Definition at line 3047 of file libisofs.h.

#define ISO_NODE (  )     ((IsoNode*)n)

Definition at line 108 of file libisofs.h.

#define ISO_NODE_ALREADY_ADDED   0xE830FFC0

Trying to add to a dir a node already added to a dir (FAILURE,HIGH, -64).

Definition at line 3709 of file libisofs.h.

#define ISO_NODE_DOESNT_EXIST   0xE830FFBD

A requested node does not exist (FAILURE,HIGH, -66).

Definition at line 3718 of file libisofs.h.

#define ISO_NODE_IS_BOOTCAT (  )     (iso_node_get_type(n) == LIBISO_BOOT)

Definition at line 100 of file libisofs.h.

#define ISO_NODE_IS_DIR (  )     (iso_node_get_type(n) == LIBISO_DIR)

Definition at line 96 of file libisofs.h.

#define ISO_NODE_IS_FILE (  )     (iso_node_get_type(n) == LIBISO_FILE)

Definition at line 97 of file libisofs.h.

#define ISO_NODE_IS_SPECIAL (  )     (iso_node_get_type(n) == LIBISO_SPECIAL)

Definition at line 99 of file libisofs.h.

#define ISO_NODE_IS_SYMLINK (  )     (iso_node_get_type(n) == LIBISO_SYMLINK)

Definition at line 98 of file libisofs.h.

#define ISO_NODE_NAME_NOT_UNIQUE   0xE830FFBF

Node with same name already exists (FAILURE,HIGH, -65).

Definition at line 3712 of file libisofs.h.

#define ISO_NODE_NOT_ADDED_TO_DIR   0xE830FFBE

Trying to remove a node that was not added to dir (FAILURE,HIGH, -65).

Definition at line 3715 of file libisofs.h.

#define ISO_NONE   0

special return value, it could be or not an error depending on the context.

Definition at line 3671 of file libisofs.h.

#define ISO_NULL_POINTER   0xE830FFFB

NULL pointer as value for an arg.

that doesn't allow NULL (FAILURE,HIGH, -5)

Definition at line 3688 of file libisofs.h.

#define ISO_OUT_OF_MEM   0xF030FFFA

Memory allocation error (FATAL,HIGH, -6).

Definition at line 3691 of file libisofs.h.

#define ISO_SPECIAL (  )     ((IsoSpecial*)(ISO_NODE_IS_SPECIAL(n) ? n : NULL))

Definition at line 106 of file libisofs.h.

#define ISO_SUCCESS   1

successfully execution

Definition at line 3665 of file libisofs.h.

#define ISO_SUSP_MULTIPLE_ER   0xD030FEB5

Multiple ER SUSP entries found (WARNING,HIGH, -331).

Definition at line 3845 of file libisofs.h.

#define ISO_SUSP_UNHANDLED   0xC020FEB6

Error on a RR entry that can be ignored (HINT,MEDIUM, -330).

Definition at line 3842 of file libisofs.h.

#define ISO_SYMLINK (  )     ((IsoSymlink*)(ISO_NODE_IS_SYMLINK(n) ? n : NULL))

Definition at line 105 of file libisofs.h.

#define ISO_THREAD_ERROR   0xF030FFF7

Can't create a needed thread (FATAL,HIGH, -9).

Definition at line 3700 of file libisofs.h.

#define ISO_UNSUPPORTED_ECMA119   0xE830FEBC

Unsupported ECMA-119 feature (FAILURE,HIGH, -324).

Definition at line 3824 of file libisofs.h.

#define ISO_UNSUPPORTED_EL_TORITO   0xE030FEBA

Unsupported El-Torito feature (SORRY,HIGH, -326).

Definition at line 3830 of file libisofs.h.

#define ISO_UNSUPPORTED_RR   0xE030FEBE

Unsupported RR feature (SORRY,HIGH, -322).

Definition at line 3818 of file libisofs.h.

#define ISO_UNSUPPORTED_SUSP   0xE030FEB8

Unsupported SUSP feature (SORRY,HIGH, -328).

Definition at line 3836 of file libisofs.h.

#define ISO_UNSUPPORTED_VD   0xC020FEB4

Unsupported volume descriptor found (HINT,MEDIUM, -332).

Definition at line 3848 of file libisofs.h.

#define ISO_WRITE_ERROR   0xE830FFF6

Write error (FAILURE,HIGH, -10).

Definition at line 3703 of file libisofs.h.

#define ISO_WRONG_ARG_VALUE   0xE830FFF8

Invalid parameter value (FAILURE,HIGH, -8).

Definition at line 3697 of file libisofs.h.

#define ISO_WRONG_ECMA119   0xE830FEBD

Wrong or damaged ECMA-119 (FAILURE,HIGH, -323).

Definition at line 3821 of file libisofs.h.

#define ISO_WRONG_EL_TORITO   0xE030FEBB

Wrong or damaged El-Torito catalog (SORRY,HIGH, -325).

Definition at line 3827 of file libisofs.h.

#define ISO_WRONG_PVD   0xE830FEC0

Wrong or damaged Primary Volume Descriptor (FAILURE,HIGH, -320) This could mean that the file is not a valid ISO image.

Definition at line 3812 of file libisofs.h.

#define ISO_WRONG_RR   0xE030FEBF

Wrong or damaged RR entry (SORRY,HIGH, -321).

Definition at line 3815 of file libisofs.h.

#define ISO_WRONG_RR_WARN   0xD030FEB7

Error on a RR entry that can be ignored (WARNING,HIGH, -329).

Definition at line 3839 of file libisofs.h.


Typedef Documentation

typedef struct el_torito_boot_image ElToritoBootImage

It represents an El-Torito boot image.

Since:
0.6.2

Definition at line 123 of file libisofs.h.

typedef int(* iso_node_xinfo_func)(void *data, int flag)

Function to handle particular extended information.

The function pointer acts as an identifier for the type of the information. Structs with same information type must use the same function.

Parameters:
data Attached data
flag What to do with the data. At this time the following values are defined: -> 1 the data must be freed
Returns:
1 in any case.
Since:
0.6.4

Definition at line 1853 of file libisofs.h.

typedef struct Iso_Boot IsoBoot

An special type of IsoNode that acts as a placeholder for an El-Torito boot catalog.

Once written, it will appear as a regular file.

Since:
0.6.2

Definition at line 131 of file libisofs.h.

Source for image reading.

See also:
struct iso_data_source
Since:
0.6.2

Definition at line 215 of file libisofs.h.

typedef struct Iso_Dir IsoDir

A directory in the iso tree.

It is an special type of IsoNode and can be casted to it in any case.

Since:
0.6.2

Definition at line 42 of file libisofs.h.

typedef struct Iso_Dir_Iter IsoDirIter

Context for iterate on directory children.

See also:
iso_dir_get_children()
Since:
0.6.2

Definition at line 116 of file libisofs.h.

typedef struct Iso_File IsoFile

A regular file in the iso tree.

It is an special type of IsoNode and can be casted to it in any case.

Since:
0.6.2

Definition at line 58 of file libisofs.h.

POSIX abstraction for source files.

See also:
struct iso_file_source
Since:
0.6.2

Definition at line 303 of file libisofs.h.

Interface that defines the operations (methods) available for an IsoFileSource.

See also:
struct IsoFileSource_Iface
Since:
0.6.2

Definition at line 320 of file libisofs.h.

typedef struct iso_filesystem IsoFilesystem

Abstract for source filesystems.

See also:
struct iso_filesystem
Since:
0.6.2

Definition at line 311 of file libisofs.h.

typedef struct iso_find_condition IsoFindCondition

Since:
0.6.4

Definition at line 2277 of file libisofs.h.

typedef struct Iso_Image IsoImage

Context for image creation.

It holds the files that will be added to image, and several options to control libisofs behavior.

Since:
0.6.2

Definition at line 23 of file libisofs.h.

IsoFilesystem implementation to deal with ISO images, and to offer a way to access specific information of the image, such as several volume attributes, extensions being used, El-Torito artifacts.

..

Since:
0.6.2

Definition at line 329 of file libisofs.h.

typedef struct Iso_Node IsoNode

Definition at line 34 of file libisofs.h.

typedef struct iso_read_image_features IsoReadImageFeatures

Return information for image.

This is optionally allocated by libisofs, as a way to inform user about the features of an existing image, such as extensions present, size, ...

See also:
iso_image_import()
Since:
0.6.2

Definition at line 295 of file libisofs.h.

typedef struct iso_read_opts IsoReadOpts

Options for image reading or import.

See also:
iso_read_opts_new()
Since:
0.6.2

Definition at line 207 of file libisofs.h.

typedef struct Iso_Special IsoSpecial

An special file in the iso tree.

This is used to represent any POSIX file other that regular files, directories or symlinks, i.e.: socket, block and character devices, and fifos. It is an special type of IsoNode and can be casted to it in any case.

Since:
0.6.2

Definition at line 68 of file libisofs.h.

typedef struct iso_stream IsoStream

Representation of file contents.

It is an stream of bytes, functionally like a pipe.

Since:
0.6.4

Definition at line 670 of file libisofs.h.

Interface that defines the operations (methods) available for an IsoStream.

See also:
struct IsoStream_Iface
Since:
0.6.4

Definition at line 679 of file libisofs.h.

typedef struct Iso_Symlink IsoSymlink

A symbolic link in the iso tree.

It is an special type of IsoNode and can be casted to it in any case.

Since:
0.6.2

Definition at line 50 of file libisofs.h.

typedef struct iso_write_opts IsoWriteOpts

Options for image written.

See also:
iso_write_opts_new()
Since:
0.6.2

Definition at line 200 of file libisofs.h.


Enumeration Type Documentation

El-Torito bootable image type.

Since:
0.6.2
Enumerator:
ELTORITO_FLOPPY_EMUL 
ELTORITO_HARD_DISC_EMUL 
ELTORITO_NO_EMUL 

Definition at line 153 of file libisofs.h.

00153                               {
00154     ELTORITO_FLOPPY_EMUL,
00155     ELTORITO_HARD_DISC_EMUL,
00156     ELTORITO_NO_EMUL
00157 };

Possible comparison between IsoNode and given conditions.

Since:
0.6.4
Enumerator:
ISO_FIND_COND_GREATER 
ISO_FIND_COND_GREATER_OR_EQUAL 
ISO_FIND_COND_EQUAL 
ISO_FIND_COND_LESS 
ISO_FIND_COND_LESS_OR_EQUAL 

Definition at line 2339 of file libisofs.h.

Replace mode used when addding a node to 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.

Since:
0.6.2
Enumerator:
ISO_REPLACE_NEVER  Never replace an existing node, and instead fail with ISO_NODE_NAME_NOT_UNIQUE.
ISO_REPLACE_ALWAYS  Always replace the old node with the new.
ISO_REPLACE_IF_SAME_TYPE  Replace with the new node if it is the same file type.
ISO_REPLACE_IF_SAME_TYPE_AND_NEWER  Replace with the new node if it is the same file type and its ctime is newer than the old one.
ISO_REPLACE_IF_NEWER  Replace with the new node if its ctime is newer than the old one.

Definition at line 166 of file libisofs.h.

00166                       {
00167     /**
00168      * Never replace an existing node, and instead fail with 
00169      * ISO_NODE_NAME_NOT_UNIQUE.
00170      */
00171     ISO_REPLACE_NEVER,
00172     /**
00173      * Always replace the old node with the new.
00174      */
00175     ISO_REPLACE_ALWAYS,
00176     /**
00177      * Replace with the new node if it is the same file type
00178      */
00179     ISO_REPLACE_IF_SAME_TYPE,
00180     /**
00181      * Replace with the new node if it is the same file type and its ctime
00182      * is newer than the old one.
00183      */
00184     ISO_REPLACE_IF_SAME_TYPE_AND_NEWER,
00185     /**
00186      * Replace with the new node if its ctime is newer than the old one.
00187      */
00188     ISO_REPLACE_IF_NEWER
00189     /*
00190      * TODO #00006 define more values
00191      *  -if both are dirs, add contents (and what to do with conflicts?)
00192      */
00193 };

Flag used to hide a file in the RR/ISO or Joliet tree.

See also:
iso_node_set_hidden
Since:
0.6.2
Enumerator:
LIBISO_HIDE_ON_RR  Hide the node in the ECMA-119 / RR tree.
LIBISO_HIDE_ON_JOLIET  Hide the node in the Joliet tree, if Joliet extension are enabled.
LIBISO_HIDE_ON_1999  Hide the node in the ISO-9660:1999 tree, if that format is enabled.

Definition at line 139 of file libisofs.h.

00139                      {
00140     /** Hide the node in the ECMA-119 / RR tree */
00141     LIBISO_HIDE_ON_RR = 1 << 0,
00142     /** Hide the node in the Joliet tree, if Joliet extension are enabled */
00143     LIBISO_HIDE_ON_JOLIET = 1 << 1,
00144     /** Hide the node in the ISO-9660:1999 tree, if that format is enabled */
00145     LIBISO_HIDE_ON_1999 = 1 << 2
00146 };

The type of an IsoNode.

When an user gets an IsoNode from an image, (s)he can use iso_node_get_type() to get the current type of the node, and then cast to the appropriate subtype. For example:

... IsoNode *node; res = iso_dir_iter_next(iter, &node); if (res == 1 && iso_node_get_type(node) == LIBISO_DIR) { IsoDir *dir = (IsoDir *)node; ... }

Since:
0.6.2
Enumerator:
LIBISO_DIR 
LIBISO_FILE 
LIBISO_SYMLINK 
LIBISO_SPECIAL 
LIBISO_BOOT 

Definition at line 87 of file libisofs.h.

00087                  {
00088     LIBISO_DIR,
00089     LIBISO_FILE,
00090     LIBISO_SYMLINK,
00091     LIBISO_SPECIAL,
00092     LIBISO_BOOT
00093 };


Function Documentation

void el_torito_patch_isolinux_image ( ElToritoBootImage bootimg  ) 

Specifies that this image needs to be patched.

This involves the writting of a 56 bytes boot information table at offset 8 of the boot image file. The original boot image file won't be modified. This is needed for isolinux boot images.

Since:
0.6.2

void el_torito_set_load_seg ( ElToritoBootImage bootimg,
short  segment 
)

Sets the load segment for the initial boot image.

This is only for no emulation boot images, and is a NOP for other image types.

Since:
0.6.2

void el_torito_set_load_size ( ElToritoBootImage bootimg,
short  sectors 
)

Sets the number of sectors (512b) to be load at load segment during the initial boot procedure.

This is only for no emulation boot images, and is a NOP for other image types.

Since:
0.6.2

void el_torito_set_no_bootable ( ElToritoBootImage bootimg  ) 

Marks the specified boot image as not bootable.

Since:
0.6.2

int iso_data_source_new_from_file ( const char *  path,
IsoDataSource **  src 
)

Create a new IsoDataSource from a local file.

This is suitable for accessing regular .iso images, or to acces drives via its block device and standard POSIX I/O calls.

Parameters:
path The path of the file
src Will be filled with the pointer to the newly created data source.
Returns:
1 on success, < 0 on error.
Since:
0.6.2

void iso_data_source_ref ( IsoDataSource src  ) 

Increments the reference counting of the given IsoDataSource.

Since:
0.6.2

void iso_data_source_unref ( IsoDataSource src  ) 

Decrements the reference counting of the given IsoDataSource, freeing it if refcount reach 0.

Since:
0.6.2

int iso_dir_add_node ( IsoDir dir,
IsoNode child,
enum iso_replace_mode  replace 
)

Add a new node to a dir.

Note that this function don't add a new ref to the node, so you don't need to free it, it will be automatically freed when the dir is deleted. Of course, if you want to keep using the node after the dir life, you need to iso_node_ref() it.

Parameters:
dir the dir where to add the node
child 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. Otherwise this function will return a failure, and the child won't be inserted.
replace if the dir already contains a node with the same name, whether to replace or not the old node with this.
Returns:
number of nodes in dir if succes, < 0 otherwise Possible errors: ISO_NULL_POINTER, if dir or child are NULL 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_WRONG_ARG_VALUE, if child == dir, or replace != (0,1)
Since:
0.6.2

int iso_dir_find_children ( IsoDir dir,
IsoFindCondition cond,
IsoDirIter **  iter 
)

Find all directory children that match the given condition.

Parameters:
dir Directory where we will search children.
cond Condition that the children must match in order to be returned. It will be free together with the iterator. Remember to delete it if this function return error.
iter Iterator that returns only the children that match condition.
Returns:
1 on success, < 0 on error
Since:
0.6.4

int iso_dir_get_children ( const IsoDir dir,
IsoDirIter **  iter 
)

Get an iterator for the children of the given dir.

You can iterate over the children with iso_dir_iter_next. When finished, 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 iso_node_remove(), while you're using the iterator. You can use iso_dir_iter_take() or iso_dir_iter_remove() instead.

You can use the iterator in the way like this

IsoDirIter *iter; IsoNode *node; if ( iso_dir_get_children(dir, &iter) != 1 ) { // handle error } while ( iso_dir_iter_next(iter, &node) == 1 ) { // do something with the child } iso_dir_iter_free(iter);

An iterator is intended to be used in a single iteration over the children of a dir. Thus, it should be treated as a temporary object, and free as soon as possible.

Returns:
1 success, < 0 error Possible errors: ISO_NULL_POINTER, if dir or iter are NULL ISO_OUT_OF_MEM
Since:
0.6.2

int iso_dir_get_children_count ( IsoDir dir  ) 

Get the number of children of a directory.

Returns:
>= 0 number of items, < 0 error Possible errors: ISO_NULL_POINTER, if dir is NULL
Since:
0.6.2

int iso_dir_get_node ( IsoDir dir,
const char *  name,
IsoNode **  node 
)

Locate a node inside a given dir.

Parameters:
dir The dir where to look for the node.
name The name of the node
node Location for a pointer to the node, it will filled with NULL if the dir doesn't have a child with the given name. The node will be owned by the dir and shouldn't be unref(). Just call iso_node_ref() to get your own reference to the node. Note that you can pass NULL is the only thing you want to do is check if a node with such name already exists on dir.
Returns:
1 node found, 0 child has no such node, < 0 error Possible errors: ISO_NULL_POINTER, if dir or name are NULL
Since:
0.6.2

void iso_dir_iter_free ( IsoDirIter iter  ) 

Free a dir iterator.

Since:
0.6.2

int iso_dir_iter_has_next ( IsoDirIter iter  ) 

Check if there're more children.

Returns:
1 dir has more elements, 0 no, < 0 error Possible errors: ISO_NULL_POINTER, if iter is NULL
Since:
0.6.2

int iso_dir_iter_next ( IsoDirIter iter,
IsoNode **  node 
)

Get the next child.

Take care that the node is owned by its parent, and will be unref() when the parent is freed. If you want your own ref to it, call iso_node_ref() on it.

Returns:
1 success, 0 if dir has no more elements, < 0 error Possible errors: ISO_NULL_POINTER, if node or iter are NULL ISO_ERROR, on wrong iter usage, usual caused by modiying the dir during iteration
Since:
0.6.2

int iso_dir_iter_remove ( IsoDirIter iter  ) 

Removes a child from a directory during an iteration and unref() it.

It's like iso_node_remove(), but to be used during a directory 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 them is not allowed and you will get an ISO_ERROR in second call.

Returns:
1 on succes, < 0 error Possible errors: ISO_NULL_POINTER, if iter is NULL ISO_ERROR, on wrong iter usage, for example by call this before iso_dir_iter_next.
Since:
0.6.2

int iso_dir_iter_take ( IsoDirIter iter  ) 

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. The node removed will be the last returned by the iteration.

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.

Returns:
1 on succes, < 0 error Possible errors: ISO_NULL_POINTER, if iter is NULL ISO_ERROR, on wrong iter usage, for example by call this before iso_dir_iter_next.
Since:
0.6.2

int iso_error_get_code ( int  e  ) 

Get the message queue code of a libisofs error.

int iso_error_get_priority ( int  e  ) 

Get the priority of a given error.

Returns:
0x00000000 -> ZERO 0x10000000 -> LOW 0x20000000 -> MEDIUM 0x30000000 -> HIGH
Since:
0.6.2

int iso_error_get_severity ( int  e  ) 

Get the severity of a given error code.

Returns:
0x10000000 -> DEBUG 0x20000000 -> UPDATE 0x30000000 -> NOTE 0x40000000 -> HINT 0x50000000 -> WARNING 0x60000000 -> SORRY 0x64000000 -> MISHAP 0x68000000 -> FAILURE 0x70000000 -> FATAL 0x71000000 -> ABORT
Since:
0.6.2

const char* iso_error_to_msg ( int  errcode  ) 

Get a textual description of a libisofs error.

Since:
0.6.2

int iso_file_get_old_image_lba ( IsoFile file,
uint32_t *  lba,
int  flag 
)

Get the block lba of a file node, if it was imported from an old image.

Parameters:
file The file
lba Will be filled with the kba
flag Reserved for future usage, submit 0
Returns:
1 if lba is valid (file comes from old image), 0 if file was newly added, i.e. it does not come from an old image, < 0 error
Since:
0.6.4

off_t iso_file_get_size ( IsoFile file  ) 

Get the size of the file, in bytes.

Since:
0.6.2

int iso_file_get_sort_weight ( IsoFile file  ) 

Get the sort weight of a file.

Since:
0.6.2

IsoStream* iso_file_get_stream ( IsoFile file  ) 

Get the IsoStream that represents the contents of the given IsoFile.

If you open() the stream, it should be close() before image generation.

Returns:
The IsoStream. No extra ref is added, so the IsoStream belong to the IsoFile, and it may be freed together with it. Add your own ref with iso_stream_ref() if you need it.
Since:
0.6.4

int iso_file_source_access ( IsoFileSource src  ) 

Check if the process has access to read file contents.

Note that this is not necessarily related with (l)stat functions. For example, in a filesystem implementation to deal with an ISO image, if the user has read access to the image it will be able to read all files inside it, despite of the particular permission of each file in the RR tree, that are what the above functions return.

Returns:
1 if process has read access, < 0 on error Error codes: ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER
Since:
0.6.2

int iso_file_source_close ( IsoFileSource src  ) 

Close a previuously openned file.

Returns:
1 on success, < 0 on error Error codes: ISO_FILE_ERROR ISO_NULL_POINTER ISO_FILE_NOT_OPENED
Since:
0.6.2

IsoFilesystem* iso_file_source_get_filesystem ( IsoFileSource src  ) 

Get the filesystem for this source.

No extra ref is added, so you musn't unref the IsoFilesystem.

Returns:
The filesystem, NULL on error
Since:
0.6.2

char* iso_file_source_get_name ( IsoFileSource src  ) 

Get the name of the file, with the dir component of the path.

Returns:
the name of the file, it should be freed when no more needed.
Since:
0.6.2

char* iso_file_source_get_path ( IsoFileSource src  ) 

Get the path, relative to the filesystem this file source belongs to.

Returns:
the path of the FileSource inside the filesystem, it should be freed when no more needed.
Since:
0.6.2

off_t iso_file_source_lseek ( IsoFileSource src,
off_t  offset,
int  flag 
)

Repositions the offset of the given IsoFileSource (must be opened) to the given offset according to the value of flag.

Parameters:
offset in bytes
flag 0 The offset is set to offset bytes (SEEK_SET) 1 The offset is set to its current location plus offset bytes (SEEK_CUR) 2 The offset is set to the size of the file plus offset bytes (SEEK_END).
Returns:
Absolute offset posistion on the file, or < 0 on error. Cast the returning value to int to get a valid libisofs error.
Since:
0.6.4

int iso_file_source_lstat ( IsoFileSource src,
struct stat *  info 
)

Get information about the file.

Returns:
1 success, < 0 error Error codes: ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER
Since:
0.6.2

int iso_file_source_open ( IsoFileSource src  ) 

Opens the source.

Returns:
1 on success, < 0 on error Error codes: ISO_FILE_ALREADY_OPENED ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER
Since:
0.6.2

int iso_file_source_read ( IsoFileSource src,
void *  buf,
size_t  count 
)

Attempts to read up to count bytes from the given source into the buffer starting at buf.

The file src must be open() before calling this, and close() when no more needed. Not valid for dirs. On symlinks it reads the destination file.

Parameters:
src The given source
buf Pointer to a buffer of at least count bytes where the read data will be stored
count Bytes to read
Returns:
number of bytes read, 0 if EOF, < 0 on error Error codes: ISO_FILE_ERROR ISO_NULL_POINTER ISO_FILE_NOT_OPENED ISO_WRONG_ARG_VALUE -> if count == 0 ISO_FILE_IS_DIR ISO_OUT_OF_MEM ISO_INTERRUPTED
Since:
0.6.2

int iso_file_source_readdir ( IsoFileSource src,
IsoFileSource **  child 
)

Read a directory.

Each call to this function will return a new children, until we reach the end of file (i.e, no more children), in that case it returns 0.

The dir must be open() before calling this, and close() when no more needed. Only valid for dirs.

Note that "." and ".." children MUST NOT BE returned.

Parameters:
child pointer to be filled with the given child. Undefined on error or OEF
Returns:
1 on success, 0 if EOF (no more children), < 0 on error Error codes: ISO_FILE_ERROR ISO_NULL_POINTER ISO_FILE_NOT_OPENED ISO_FILE_IS_NOT_DIR ISO_OUT_OF_MEM
Since:
0.6.2

int iso_file_source_readlink ( IsoFileSource src,
char *  buf,
size_t  bufsiz 
)

Read the destination of a symlink.

You don't need to open the file to call this.

Parameters:
src An IsoFileSource corresponding to a symbolic link.
buf allocated buffer of at least bufsiz bytes. The dest. will be copied there, and it will be NULL-terminated
bufsiz characters to be copied. Destination link will be truncated if it is larger than given size. This include the '' character.
Returns:
1 on success, < 0 on error Error codes: ISO_FILE_ERROR ISO_NULL_POINTER ISO_WRONG_ARG_VALUE -> if bufsiz <= 0 ISO_FILE_IS_NOT_SYMLINK ISO_OUT_OF_MEM ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST
Since:
0.6.2

void iso_file_source_ref ( IsoFileSource src  ) 

Take a ref to the given IsoFileSource.

Since:
0.6.2

int iso_file_source_stat ( IsoFileSource src,
struct stat *  info 
)

Get information about the file.

If the file is a symlink, the info returned refers to the destination.

Returns:
1 success, < 0 error Error codes: ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER
Since:
0.6.2

void iso_file_source_unref ( IsoFileSource src  ) 

Drop your ref to the given IsoFileSource, eventually freeing the associated system resources.

Since:
0.6.2

void iso_filesystem_ref ( IsoFilesystem fs  ) 

Take a ref to the given IsoFilesystem.

Since:
0.6.2

void iso_filesystem_unref ( IsoFilesystem fs  ) 

Drop your ref to the given IsoFilesystem, evetually freeing associated resources.

Since:
0.6.2

void iso_finish (  ) 

Finalize libisofs.

Since:
0.6.2

void* iso_get_messenger (  ) 

Return the messenger object handle used by libisofs.

This handle may be used by related libraries to their own compatible messenger objects and thus to direct their messages to the libisofs message queue. See also: libburn, API function burn_set_messenger().

Returns:
the handle. Do only use with compatible
Since:
0.6.2

int iso_image_attach_data ( IsoImage image,
void *  data,
void(*)(void *)  give_up 
)

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 has data attached, the old data will be freed.

Parameters:
data Pointer to application defined data that will be attached to the image. You can pass NULL to remove any already attached data.
give_up 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 causes data to be freed. It can be NULL if you don't need it.
Returns:
1 on succes, < 0 on error
Since:
0.6.2

int iso_image_create_burn_source ( IsoImage image,
IsoWriteOpts opts,
struct burn_source **  burn_src 
)

Create a burn_source to actually write the image.

That burn_source can be used with libburn as a data source for a track.

Parameters:
image The image to write.
opts The options for image generation. All needed data will be copied, so you can free the given struct once this function returns.
burn_src Location where the pointer to the burn_source will be stored
Returns:
1 on success, < 0 on error
Since:
0.6.2

int iso_image_filesystem_new ( IsoDataSource src,
IsoReadOpts opts,
int  msgid,
IsoImageFilesystem **  fs 
)

Create a new IsoFilesystem to access a existent ISO image.

Parameters:
src Data source to access data.
opts Image read options
msgid An image identifer, obtained with iso_image_get_msg_id(), used to associated messages issued by the filesystem implementation with an existent image. If you are not using this filesystem in relation with any image context, just use 0x1fffff as the value for this parameter.
fs Will be filled with a pointer to the filesystem that can be used to access image contents.
1 on success, < 0 on error
Since:
0.6.2

const char* iso_image_fs_get_abstract_file_id ( IsoImageFilesystem fs  ) 

Get the abstract file identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_application_id ( IsoImageFilesystem fs  ) 

Get the application identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_biblio_file_id ( IsoImageFilesystem fs  ) 

Get the biblio file identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_copyright_file_id ( IsoImageFilesystem fs  ) 

Get the copyright file identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_data_preparer_id ( IsoImageFilesystem fs  ) 

Get the data preparer identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_publisher_id ( IsoImageFilesystem fs  ) 

Get the publisher identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_system_id ( IsoImageFilesystem fs  ) 

Get the system identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_volset_id ( IsoImageFilesystem fs  ) 

Get the volset identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_fs_get_volume_id ( IsoImageFilesystem fs  ) 

Get the volume identifier for an existent image.

The returned string belong to the IsoImageFilesystem and shouldn't be free() nor modified.

Since:
0.6.2

const char* iso_image_get_abstract_file_id ( const IsoImage image  ) 

Get the abstract information of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

const char* iso_image_get_application_id ( const IsoImage image  ) 

Get the application id of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

void* iso_image_get_attached_data ( IsoImage image  ) 

The the data previously attached with iso_image_attach_data().

Since:
0.6.2

const char* iso_image_get_biblio_file_id ( const IsoImage image  ) 

Get the biblio information of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

int iso_image_get_boot_image ( IsoImage image,
ElToritoBootImage **  boot,
IsoFile **  imgnode,
IsoBoot **  catnode 
)

Get El-Torito boot image of an ISO image, if any.

This can be useful, for example, to check if a volume read from a previous session or an existing image is bootable. It can also be useful to get the image and catalog tree nodes. An application would want those, for example, to prevent the user removing it.

Both nodes are owned by libisofs and should not be freed. You can get your own ref with iso_node_ref(). You can can also check if the node is already on the tree by getting its parent (note that when reading El-Torito info from a previous image, the nodes might not be on the tree even if you haven't removed them). Remember that you'll need to get a new ref (with iso_node_ref()) before inserting them again to the tree, and probably you will also need to set the name or permissions.

Parameters:
image The image from which to get the boot image.
boot If not NULL, it will be filled with a pointer to the boot image, if any. That object is owned by the IsoImage and should not be freed by the user, nor dereferenced once the last reference to the IsoImage was disposed via iso_image_unref().
imgnode When not NULL, it will be filled with the image tree node. No extra ref is added, you can use iso_node_ref() to get one if you need it.
catnode When not NULL, it will be filled with the catnode tree node. No extra ref is added, you can use iso_node_ref() to get one if you need it.
Returns:
1 on success, 0 is the image is not bootable (i.e., it has no El-Torito image), < 0 error.
Since:
0.6.2

const char* iso_image_get_copyright_file_id ( const IsoImage image  ) 

Get the copyright information of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

const char* iso_image_get_data_preparer_id ( const IsoImage image  ) 

Get the data preparer of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

int iso_image_get_msg_id ( IsoImage image  ) 

Get the id of an IsoImage, used for message reporting.

This message id, retrieved with iso_obtain_msgs(), can be used to distinguish what IsoImage has isssued a given message.

Since:
0.6.2

const char* iso_image_get_publisher_id ( const IsoImage image  ) 

Get the publisher of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

IsoDir* iso_image_get_root ( const IsoImage image  ) 

Get the root directory of the image.

No extra ref is added to it, so you musn't unref it. Use iso_node_ref() if you want to get your own reference.

Since:
0.6.2

const char* iso_image_get_system_id ( const IsoImage image  ) 

Get the system id of a image.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

const char* iso_image_get_volset_id ( const IsoImage image  ) 

Get the volset identifier.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

const char* iso_image_get_volume_id ( const IsoImage image  ) 

Get the volume identifier.

The returned string is owned by the image and should not be freed nor changed.

Since:
0.6.2

int iso_image_import ( IsoImage image,
IsoDataSource src,
IsoReadOpts opts,
IsoReadImageFeatures **  features 
)

Import a previous session or image, for growing or modify.

Parameters:
image The image context to which old image will be imported. Note that all files added to image, and image attributes, will be replaced with the contents of the old image. TODO #00025 support for merging old image files
src Data Source from which old image will be read. A extra reference is added, so you still need to iso_data_source_unref() yours.
opts Options for image import. All needed data will be copied, so you can free the given struct once this function returns.
features If not NULL, a new IsoReadImageFeatures will be allocated and filled with the features of the old image. It should be freed with iso_read_image_features_destroy() when no more needed. You can pass NULL if you're not interested on them.
Returns:
1 on success, < 0 on error
Since:
0.6.2

int iso_image_new ( const char *  name,
IsoImage **  image 
)

Create a new image, empty.

The image will be owned by you and should be unref() when no more needed.

Parameters:
name Name of the image. This will be used as volset_id and volume_id.
image Location where the image pointer will be stored.
Returns:
1 sucess, < 0 error
Since:
0.6.2

void iso_image_ref ( IsoImage image  ) 

Increments the reference counting of the given image.

Since:
0.6.2

void iso_image_remove_boot_image ( IsoImage image  ) 

Removes the El-Torito bootable image.

The IsoBoot node that acts as placeholder for the catalog is also removed for the image tree, if there. If the image is not bootable (don't have el-torito boot image) this function just returns.

Since:
0.6.2

void iso_image_set_abstract_file_id ( IsoImage image,
const char *  abstract_file_id 
)

Fill abstract information for the image.

Usually this refers to a file on disc. Up to 37 characters.

Since:
0.6.2

void iso_image_set_application_id ( IsoImage image,
const char *  application_id 
)

Fill in the application id for a image.

Up to 128 chars.

Since:
0.6.2

void iso_image_set_biblio_file_id ( IsoImage image,
const char *  biblio_file_id 
)

Fill biblio information for the image.

Usually this refers to a file on disc. Up to 37 characters.

Since:
0.6.2

int iso_image_set_boot_image ( IsoImage image,
const char *  image_path,
enum eltorito_boot_media_type  type,
const char *  catalog_path,
ElToritoBootImage **  boot 
)

Create a bootable image by adding a El-Torito boot image.

This also add a catalog boot node to the image filesystem tree.

Parameters:
image The image to make bootable. If it was already bootable this function returns an error and the image remains unmodified.
image_path The path on the image tree of a regular file to use as default boot image.
type The boot media type. This can be one of 3 types:
  • Floppy emulation: Boot image file must be exactly 1200 kB, 1440 kB or 2880 kB.
  • Hard disc emulation: The image must begin with a master boot record with a single image.
  • No emulation. You should specify load segment and load size of image.
catalog_path The path on the image tree where the catalog will be stored. The directory component of this path must be a directory existent on the image tree, and the filename component must be unique among all children of that directory on image. Otherwise a correspodent error code will be returned. This function will add an IsoBoot node that acts as a placeholder for the real catalog, that will be generated at image creation time.
boot Location where a pointer to the added boot image will be stored. That object is owned by the IsoImage and should not be freed by the user, nor dereferenced once the last reference to the IsoImage was disposed via iso_image_unref(). A NULL value is allowed if you don't need a reference to the boot image.
Returns:
1 on success, < 0 on error
Since:
0.6.2

void iso_image_set_copyright_file_id ( IsoImage image,
const char *  copyright_file_id 
)

Fill copyright information for the image.

Usually this refers to a file on disc. Up to 37 characters.

Since:
0.6.2

void iso_image_set_data_preparer_id ( IsoImage image,
const char *  data_preparer_id 
)

Fill in the data preparer for a image.

Since:
0.6.2

void iso_image_set_publisher_id ( IsoImage image,
const char *  publisher_id 
)

Fill in the publisher for a image.

Since:
0.6.2

void iso_image_set_system_id ( IsoImage image,
const char *  system_id 
)

Fill in the system id for a image.

Up to 32 characters.

Since:
0.6.2

void iso_image_set_volset_id ( IsoImage image,
const char *  volset_id 
)

Fill in the volset identifier for a image.

Since:
0.6.2

void iso_image_set_volume_id ( IsoImage image,
const char *  volume_id 
)

Fill in the volume identifier for a image.

Since:
0.6.2

void iso_image_unref ( IsoImage image  ) 

Decrements the reference couting of the given image.

If it reaches 0, the image is free, together with its tree nodes (whether their refcount reach 0 too, of course).

Since:
0.6.2

int iso_init (  ) 

Initialize libisofs.

You must call this before any usage of the library.

Returns:
1 on success, < 0 on error
Since:
0.6.2

int iso_lib_is_compatible ( int  major,
int  minor,
int  micro 
)

Check at runtime if the library is ABI compatible with the given version.

Returns:
1 lib is compatible, 0 is not.
Since:
0.6.2

void iso_lib_version ( int *  major,
int *  minor,
int *  micro 
)

The following two functions three macros are utilities to help ensuring version match of application, compile time header, and runtime library.

Get version of the libisofs library at runtime.

Since:
0.6.2

int iso_msgs_submit ( int  error_code,
char  msg_text[],
int  os_errno,
char  severity[],
int  origin 
)

Submit a message to the libisofs queueing system.

It will be queued or printed as if it was generated by libisofs itself.

Parameters:
error_code The unique error code of your message. Submit 0 if you do not have reserved error codes within the libburnia project.
msg_text Not more than ISO_MSGS_MESSAGE_LEN characters of message text.
os_errno Eventual errno related to the message. Submit 0 if the message is not related to a operating system error.
severity One of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
origin Submit 0 for now.
Returns:
1 if message was delivered, <=0 if failure
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_and ( IsoFindCondition a,
IsoFindCondition b 
)

Create a new condition that check if the two given conditions are valid.

Parameters:
a 
b IsoFindCondition to compare
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_atime ( time_t  time,
enum iso_find_comparisons  comparison 
)

Create a new condition that checks the time of last access.

Parameters:
time Time to compare against IsoNode atime.
comparison Comparison to be done between IsoNode atime and submitted time. Note that ISO_FIND_COND_GREATER, for example, is true if the node time is greater than the submitted time.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_ctime ( time_t  time,
enum iso_find_comparisons  comparison 
)

Create a new condition that checks the time of last status change.

Parameters:
time Time to compare against IsoNode ctime.
comparison Comparison to be done between IsoNode ctime and submitted time. Note that ISO_FIND_COND_GREATER, for example, is true if the node time is greater than the submitted time.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_gid ( gid_t  gid  ) 

Create a new condition that checks the node gid.

Parameters:
gid Desired Group Id.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_mode ( mode_t  mask  ) 

Create a new condition that checks the node mode against a mode mask.

It can be used to check both file type and permissions.

For example:

iso_new_find_conditions_mode(S_IFREG) : search for regular files iso_new_find_conditions_mode(S_IFCHR | S_IWUSR) : search for character devices where owner has write permissions.

Parameters:
mask Mode mask to AND against node mode.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_mtime ( time_t  time,
enum iso_find_comparisons  comparison 
)

Create a new condition that checks the time of last modification.

Parameters:
time Time to compare against IsoNode mtime.
comparison Comparison to be done between IsoNode mtime and submitted time. Note that ISO_FIND_COND_GREATER, for example, is true if the node time is greater than the submitted time.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_name ( const char *  wildcard  ) 

Create a new condition that checks if the node name matches the given wildcard.

Parameters:
wildcard 
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_not ( IsoFindCondition negate  ) 

Create a new condition that check if the given conditions is false.

Parameters:
negate 
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_or ( IsoFindCondition a,
IsoFindCondition b 
)

Create a new condition that check if at least one the two given conditions is valid.

Parameters:
a 
b IsoFindCondition to compare
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

IsoFindCondition* iso_new_find_conditions_uid ( uid_t  uid  ) 

Create a new condition that checks the node uid.

Parameters:
uid Desired User Id.
Returns:
The created IsoFindCondition, NULL on error.
Since:
0.6.4

int iso_node_add_xinfo ( IsoNode node,
iso_node_xinfo_func  proc,
void *  data 
)

Add extended information to the given node.

Extended info allows applications (and libisofs itself) to add more information to an IsoNode. You can use this facilities to associate new information with a given node.

Each node keeps a list of added extended info, meaning you can add several extended info data to each node. Each extended info you add is identified by the proc parameter, a pointer to a function that knows how to manage the external info data. Thus, in order to add several types of extended info, you need to define a "proc" function for each type.

Parameters:
node The node where to add the extended info
proc A function pointer used to identify the type of the data, and that knows how to manage it
data Extended info to add.
Returns:
1 if success, 0 if the given node already has extended info of the type defined by the "proc" function, < 0 on error
Since:
0.6.4

time_t iso_node_get_atime ( const IsoNode node  ) 

Get the time of last access to the file.

Since:
0.6.2

time_t iso_node_get_ctime ( const IsoNode node  ) 

Get the time of last status change of the file.

Since:
0.6.2

gid_t iso_node_get_gid ( const IsoNode node  ) 

Get the group id of the node.

Since:
0.6.2

mode_t iso_node_get_mode ( const IsoNode node  ) 

Get the mode of the node, both permissions and file type, as specified in 'man 2 stat'.

Since:
0.6.2

time_t iso_node_get_mtime ( const IsoNode node  ) 

Get the time of last modification of the file.

Since:
0.6.2

const char* iso_node_get_name ( const IsoNode node  ) 

Get the name of a node.

The returned string belongs to the node and should not be modified nor freed. Use strdup if you really need your own copy.

Since:
0.6.2

int iso_node_get_old_image_lba ( IsoNode node,
uint32_t *  lba,
int  flag 
)

IsoDir* iso_node_get_parent ( IsoNode node  ) 

mode_t iso_node_get_permissions ( const IsoNode node  ) 

Get the permissions for the node.

Since:
0.6.2

enum IsoNodeType iso_node_get_type ( IsoNode node  ) 

Get the type of an IsoNode.

Since:
0.6.2

uid_t iso_node_get_uid ( const IsoNode node  ) 

Get the user id of the node.

Since:
0.6.2

int iso_node_get_xinfo ( IsoNode node,
iso_node_xinfo_func  proc,
void **  data 
)

Get the given extended info (defined by the proc function) from the given node.

Parameters:
data Will be filled with the extended info corresponding to the given proc function
Returns:
1 on success, 0 if node does not have extended info of the requested type, < 0 on error
Since:
0.6.4

void iso_node_ref ( IsoNode node  ) 

Increments the reference counting of the given node.

Since:
0.6.2

int iso_node_remove ( IsoNode node  ) 

Removes a child from a directory and free (unref) it.

If you want to keep the child alive, you need to iso_node_ref() it before this call, but in that case iso_node_take() is a better alternative.

Returns:
1 on success, < 0 error
Since:
0.6.2

int iso_node_remove_xinfo ( IsoNode node,
iso_node_xinfo_func  proc 
)

Remove the given extended info (defined by the proc function) from the given node.

Returns:
1 on success, 0 if node does not have extended info of the requested type, < 0 on error
Since:
0.6.4

void iso_node_set_atime ( IsoNode node,
time_t  time 
)

Set the time of last access to the file.

Since:
0.6.2

void iso_node_set_ctime ( IsoNode node,
time_t  time 
)

Set the time of last status change of the file.

Since:
0.6.2

void iso_node_set_gid ( IsoNode node,
gid_t  gid 
)

Set the group id for the node.

This attribute is only useful when Rock Ridge extensions are enabled.

Since:
0.6.2

void iso_node_set_hidden ( IsoNode node,
int  hide_attrs 
)

Set if the node will be hidden in RR/ISO tree, Joliet tree or both.

If the file is setted as hidden in one tree, it won't be included there, so it won't be visible in a OS accessing CD using that tree. For example, GNU/Linux systems access to Rock Ridge / ISO9960 tree in order to see what is recorded on CD, while MS Windows make use of the Joliet tree. If a file is hidden only in Joliet, it won't be visible in Windows systems, while still visible in Linux.

If a file is hidden in both trees, it won't be written to image.

Parameters:
node The node that is to be hidden.
hide_attrs IsoHideNodeFlag's to set the trees in which file will be hidden.
Since:
0.6.2

void iso_node_set_mtime ( IsoNode node,
time_t  time 
)

Set the time of last modification of the file.

Since:
0.6.2

int iso_node_set_name ( IsoNode node,
const char *  name 
)

Set the name of a node.

Note that if the node is already added to a dir this can fail if dir already contains a node with the new name.

Parameters:
node The node whose name you want to change. Note that you can't change the name of the root.
name The name for the node. If you supply an empty string or a name greater than 255 characters this returns with failure, and node name is not modified.
Returns:
1 on success, < 0 on error
Since:
0.6.2

void iso_node_set_permissions ( IsoNode node,
mode_t  mode 
)

Set the permissions for the node.

This attribute is only useful when Rock Ridge extensions are enabled.

Parameters:
mode bitmask with the permissions of the node, as specified in 'man 2 stat'. The file type bitfields will be ignored, only file permissions will be modified.
Since:
0.6.2

void iso_node_set_sort_weight ( IsoNode node,
int  w 
)

Sets the order in which a node will be written on image.

High weihted files will be written first, so in a disc them will be written near the center.

Parameters:
node The node which weight will be changed. If it's a dir, this function will change the weight of all its children. For nodes other that dirs or regular files, this function has no effect.
w The weight as a integer number, the greater this value is, the closer from the begining of image the file will be written.
Since:
0.6.2

void iso_node_set_uid ( IsoNode node,
uid_t  uid 
)

Set the user id for the node.

This attribute is only useful when Rock Ridge extensions are enabled.

Since:
0.6.2

int iso_node_take ( IsoNode node  ) 

Removes a child from a directory.

The child is not freed, so you will become the owner of the node. Later you can add the node to another dir (calling iso_dir_add_node), or free it if you don't need it (with iso_node_unref).

Returns:
1 on success, < 0 error Possible errors: ISO_NULL_POINTER, if node is NULL ISO_NODE_NOT_ADDED_TO_DIR, if node doesn't belong to a dir
Since:
0.6.2

void iso_node_unref ( IsoNode node  ) 

Decrements the reference couting of the given node.

If it reach 0, the node is free, and, if the node is a directory, its children will be unref() too.

Since:
0.6.2

int iso_obtain_msgs ( char *  minimum_severity,
int *  error_code,
int *  imgid,
char  msg_text[],
char  severity[] 
)

Obtain the oldest pending libisofs message from the queue which has at least the given minimum_severity.

This message and any older message of lower severity will get discarded from the queue and is then lost forever.

Severity may be one of "NEVER", "FATAL", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL". To call with minimum_severity "NEVER" will discard the whole queue.

Parameters:
error_code Will become a unique error code as listed at the end of this header
imgid Id of the image that was issued the message.
msg_text Must provide at least ISO_MSGS_MESSAGE_LEN bytes.
severity Will become the severity related to the message and should provide at least 80 bytes.
Returns:
1 if a matching item was found, 0 if not, <0 for severe errors
Since:
0.6.2

void iso_read_image_features_destroy ( IsoReadImageFeatures f  ) 

Destroy an IsoReadImageFeatures object obtained with iso_image_import.

Since:
0.6.2

uint32_t iso_read_image_features_get_size ( IsoReadImageFeatures f  ) 

Get the size (in 2048 byte block) of the image, as reported in the PVM.

Since:
0.6.2

int iso_read_image_features_has_eltorito ( IsoReadImageFeatures f  ) 

Whether El-Torito boot record is present present in the image imported.

Since:
0.6.2

int iso_read_image_features_has_iso1999 ( IsoReadImageFeatures f  ) 

Whether the image is recorded according to ISO 9660:1999, i.e.

it has a version 2 Enhanced Volume Descriptor.

Since:
0.6.2

int iso_read_image_features_has_joliet ( IsoReadImageFeatures f  ) 

Whether Joliet extensions are present in the image imported.

Since:
0.6.2

int iso_read_image_features_has_rockridge ( IsoReadImageFeatures f  ) 

Whether RockRidge extensions are present in the image imported.

Since:
0.6.2

void iso_read_opts_free ( IsoReadOpts opts  ) 

Free an IsoReadOpts previously allocated with iso_read_opts_new().

Since:
0.6.2

int iso_read_opts_new ( IsoReadOpts **  opts,
int  profile 
)

Creates an IsoReadOpts for reading an existent image.

You should set the options desired with the correspondent setters. Note that you may want to set the start block value.

Options by default are determined by the selected profile.

Parameters:
opts Pointer to the location where the newly created IsoReadOpts will be stored. You should free it with iso_read_opts_free() when no more needed.
profile Default profile for image reading. For now the following values are defined: ---> 0 [STANDARD] Suitable for most situations. All extension are read. When both Joliet and RR extension are present, RR is used.
Returns:
1 success, < 0 error
Since:
0.6.2

int iso_read_opts_set_default_gid ( IsoReadOpts opts,
gid_t  gid 
)

Set default gid for files when RR extensions are not present.

Since:
0.6.2

int iso_read_opts_set_default_permissions ( IsoReadOpts opts,
mode_t  file_perm,
mode_t  dir_perm 
)

Set default permissions for files when RR extensions are not present.

Parameters:
file_perm Permissions for files.
dir_perm Permissions for directories.
Since:
0.6.2

int iso_read_opts_set_default_uid ( IsoReadOpts opts,
uid_t  uid 
)

Set default uid for files when RR extensions are not present.

Since:
0.6.2

int iso_read_opts_set_input_charset ( IsoReadOpts opts,
const char *  charset 
)

Set the input charset of the file names on the image.

NULL to use locale charset. You have to specify a charset if the image filenames are encoded in a charset different that the local one. This could happen, for example, if the image was created on a system with different charset.

Parameters:
charset The charset to use as input charset. You can obtain the list of charsets supported on your system executing "iconv -l" in a shell.
Since:
0.6.2

int iso_read_opts_set_no_iso1999 ( IsoReadOpts opts,
int  noiso1999 
)

Do not read ISO 9660:1999 enhanced tree.

Since:
0.6.2

int iso_read_opts_set_no_joliet ( IsoReadOpts opts,
int  nojoliet 
)

Do not read Joliet extensions.

Since:
0.6.2

int iso_read_opts_set_no_rockridge ( IsoReadOpts opts,
int  norr 
)

Do not read Rock Ridge extensions.

In most cases you don't want to use this. It could be useful if RR info is damaged, or if you want to use the Joliet tree.

Since:
0.6.2

int iso_read_opts_set_preferjoliet ( IsoReadOpts opts,
int  preferjoliet 
)

Whether to prefer Joliet over RR.

libisofs usually prefers RR over Joliet, as it give us much more info about files. So, if both extensions are present, RR is used. You can set this if you prefer Joliet, but note that this is not very recommended. This doesn't mean than RR extensions are not read: if no Joliet is present, libisofs will read RR tree.

Since:
0.6.2

int iso_read_opts_set_start_block ( IsoReadOpts opts,
uint32_t  block 
)

Set the block where the image begins.

It is usually 0, but may be different on a multisession disc.

Since:
0.6.2

int iso_ring_buffer_get_status ( struct burn_source *  b,
size_t *  size,
size_t *  free_bytes 
)

Get the status of the buffer used by a burn_source.

Parameters:
b A burn_source previously obtained with iso_image_create_burn_source().
size Will be filled with the total size of the buffer, in bytes
free_bytes Will be filled with the bytes currently available in buffer
Returns:
< 0 error, > 0 state: 1="active" : input and consumption are active 2="ending" : input has ended without error 3="failing" : input had error and ended, 5="abandoned" : consumption has ended prematurely 6="ended" : consumption has ended without input error 7="aborted" : consumption has ended after input error
Since:
0.6.2

int iso_set_abort_severity ( char *  severity  ) 

Set the minimum error severity that causes a libisofs operation to be aborted as soon as possible.

Parameters:
severity one of "FAILURE", "MISHAP", "SORRY", "WARNING", "HINT", "NOTE". Severities greater or equal than FAILURE always cause program to abort. Severities under NOTE won't never cause function abort.
Returns:
Previous abort priority on success, < 0 on error.
Since:
0.6.2

int iso_set_msgs_severities ( char *  queue_severity,
char *  print_severity,
char *  print_id 
)

Control queueing and stderr printing of messages from libisofs.

Severity may be one of "NEVER", "FATAL", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL".

Parameters:
queue_severity Gives the minimum limit for messages to be queued. Default: "NEVER". If you queue messages then you must consume them by iso_msgs_obtain().
print_severity Does the same for messages to be printed directly to stderr.
print_id A text prefix to be printed before the message.
Returns:
>0 for success, <=0 for error
Since:
0.6.2

int iso_sev_to_text ( int  severity_number,
char **  severity_name 
)

Convert a severity number into a severity name.

Parameters:
severity_number The rank number: the higher, the more severe.
severity_name A name as with iso_msgs_submit(), e.g. "SORRY".
Since:
0.6.4

dev_t iso_special_get_dev ( IsoSpecial special  ) 

Get the device id (major/minor numbers) of the given block or character device file.

The result is undefined for other kind of special files, of first be sure iso_node_get_mode() returns either S_IFBLK or S_IFCHR.

Since:
0.6.6

int iso_stream_close ( IsoStream stream  ) 

Close a previously openned IsoStream.

Returns:
1 on success, < 0 on error
Since:
0.6.4

void iso_stream_get_id ( IsoStream stream,
unsigned int *  fs_id,
dev_t *  dev_id,
ino_t *  ino_id 
)

Get an unique identifier for a given IsoStream.

Since:
0.6.4

off_t iso_stream_get_size ( IsoStream stream  ) 

Get the size of a given stream.

This function should always return the same size, even if the underlying source size changes.

Returns:
IsoStream size in bytes
Since:
0.6.4

int iso_stream_is_repeatable ( IsoStream stream  ) 

Whether the given IsoStream can be read several times, with the same results.

For example, a regular file is repeatable, you can read it as many times as you want. However, a pipe isn't.

This function doesn't take into account if the file has been modified between the two reads.

Returns:
1 if stream is repeatable, 0 if not, < 0 on error
Since:
0.6.4

int iso_stream_open ( IsoStream stream  ) 

Opens the given stream.

Remember to close the Stream before writing the image.

Returns:
1 on success, 2 file greater than expected, 3 file smaller than expected, < 0 on error
Since:
0.6.4

int iso_stream_read ( IsoStream stream,
void *  buf,
size_t  count 
)

Attempts to read up to count bytes from the given stream into the buffer starting at buf.

The stream must be open() before calling this, and close() when no more needed.

Returns:
number of bytes read, 0 if EOF, < 0 on error
Since:
0.6.4

void iso_stream_ref ( IsoStream stream  ) 

Increment reference count of an IsoStream.

Since:
0.6.4

void iso_stream_unref ( IsoStream stream  ) 

Decrement reference count of an IsoStream, and eventually free it if refcount reach 0.

Since:
0.6.4

const char* iso_symlink_get_dest ( const IsoSymlink link  ) 

Get the destination of a node.

The returned string belongs to the node and should not be modified nor freed. Use strdup if you really need your own copy.

Since:
0.6.2

int iso_symlink_set_dest ( IsoSymlink link,
const char *  dest 
)

Set the destination of a link.

Parameters:
dest New destination for the link. It must be a non-empty string, otherwise this function doesn't modify previous destination.
Returns:
1 on success, < 0 on error
Since:
0.6.2

int iso_text_to_sev ( char *  severity_name,
int *  severity_number 
)

Convert a severity name into a severity number, which gives the severity rank of the name.

Parameters:
severity_name A name as with iso_msgs_submit(), e.g. "SORRY".
severity_number The rank number: the higher, the more severe.
Returns:
>0 success, <=0 failure
Since:
0.6.4

int iso_tree_add_dir_rec ( IsoImage image,
IsoDir parent,
const char *  dir 
)

Add the contents of a dir to a given directory of the iso tree.

There are several options to control what files are added or how they are managed. Take a look at iso_tree_set_* functions to see diferent options for recursive directory addition.

TODO comment Builder and Filesystem related issues when exposing both

Parameters:
image The image to which the directory belong.
parent Directory on the image tree where to add the contents of the dir
dir Path to a dir in the filesystem
Returns:
number of nodes in parent if success, < 0 otherwise
Since:
0.6.2

int iso_tree_add_exclude ( IsoImage image,
const char *  path 
)

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.

For example, in

iso_tree_add_exclude(image, "/home/user/data/private"); iso_tree_add_dir_rec(image, root, "/home/user/data");

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., in the following example.

iso_tree_add_exclude(image, "/home/user/data"); iso_tree_add_dir_rec(image, root, "/home/user/data/private");

the directory /home/user/data/private is added. On the other, side, and foollowing the the example above,

iso_tree_add_dir_rec(image, root, "/home/user");

will exclude the directory "/home/user/data".

Absolute paths are not mandatory, you can, for example, add a relative path such as:

iso_tree_add_exclude(image, "private"); iso_tree_add_exclude(image, "user/data");

to excluve, respectively, all files or dirs named private, and also all files or dirs named data that belong to a folder named "user". Not that the above rule about deeper dirs is still valid. i.e., if you call

iso_tree_add_dir_rec(image, root, "/home/user/data/music");

it is included even containing "user/data" string. However, a possible "/home/user/data/music/user/data" is not added.

Usual wildcards, such as * or ? are also supported, with the usual meaning as stated in "man 7 glob". For example

// to exclude backup text files iso_tree_add_exclude(image, "*.~");

Returns:
1 on success, < 0 on error
Since:
0.6.2

int iso_tree_add_new_cut_out_node ( IsoImage image,
IsoDir parent,
const char *  name,
const char *  path,
off_t  offset,
off_t  size,
IsoNode **  node 
)

Add a new node to the image tree, from an existing file, and with the given name, that must not exist on dir.

The node will be cut-out to the submitted size, and its contents will be read from the given offset. This function is thus suitable for adding only a piece of a file to the image.

Parameters:
image The image
parent The directory in the image tree where the node will be added.
name The name that the node will have on image.
path The path of the file to add in the filesystem. For now only regular files and symlinks to regular files are supported.
offset Offset on the given file from where to start reading data.
size Max size of the file.
node 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 really need it. You can pass NULL in this parameter if you don't need the pointer.
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if image, parent or path are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.4

int iso_tree_add_new_dir ( IsoDir parent,
const char *  name,
IsoDir **  dir 
)

Add a new directory to the iso tree.

Permissions, owner and hidden atts are taken from parent, you can modify them later.

Parameters:
parent the dir where the new directory will be created
name name for the new dir. If a node with same name already exists on parent, this functions fails with ISO_NODE_NAME_NOT_UNIQUE.
dir 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 need it. You can pass NULL in this parameter if you don't need the pointer.
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if parent or name are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.2

int iso_tree_add_new_file ( IsoDir parent,
const char *  name,
IsoStream stream,
IsoFile **  file 
)

Add a new regular file to the iso tree.

Permissions are set to 0444, owner and hidden atts are taken from parent. You can modify any of them later.

Parameters:
parent the dir where the new file will be created
name name for the new file. If a node with same name already exists on parent, this functions fails with ISO_NODE_NAME_NOT_UNIQUE.
stream 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 if you need it.
file 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 need it. You can pass NULL in this parameter if you don't need the pointer
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if parent, name or dest are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.4

int iso_tree_add_new_node ( IsoImage image,
IsoDir parent,
const char *  name,
const char *  path,
IsoNode **  node 
)

Add a new node to the image tree, from an existing file, and with the given name, that must not exist on dir.

Parameters:
image The image
parent The directory in the image tree where the node will be added.
name The name that the node will have on image.
path The path of the file to add in the filesystem.
node 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 really need it. You can pass NULL in this parameter if you don't need the pointer.
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if image, parent or path are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.4

int iso_tree_add_new_special ( IsoDir parent,
const char *  name,
mode_t  mode,
dev_t  dev,
IsoSpecial **  special 
)

Add a new special file to the directory tree.

As far as libisofs concerns, an 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 by setting mode propertly (see man 2 stat).

Note that special files are only written to image when Rock Ridge extensions are enabled. Moreover, a special file is just a directory entry in the image tree, no data is written beyond that.

Owner and hidden atts are taken from parent. You can modify any of them later.

Parameters:
parent the dir where the new special file will be created
name name for the new special file. If a node with same name already exists on parent, this functions fails with ISO_NODE_NAME_NOT_UNIQUE.
mode file type and permissions for the new node. Note that you can't specify any kind of file here, only special types are allowed. i.e, S_IFSOCK, S_IFBLK, S_IFCHR and S_IFIFO are valid types; S_IFLNK, S_IFREG and S_IFDIR aren't.
dev device ID, equivalent to the st_rdev field in man 2 stat.
special 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 really need it. You can pass NULL in this parameter if you don't need the pointer.
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if parent, name or dest are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_WRONG_ARG_VALUE if you select a incorrect mode ISO_OUT_OF_MEM
Since:
0.6.2

int iso_tree_add_new_symlink ( IsoDir parent,
const char *  name,
const char *  dest,
IsoSymlink **  link 
)

Add a new symlink to the directory tree.

Permissions are set to 0777, owner and hidden atts are taken from parent. You can modify any of them later.

Parameters:
parent the dir where the new symlink will be created
name name for the new symlink. If a node with same name already exists on parent, this functions fails with ISO_NODE_NAME_NOT_UNIQUE.
dest destination of the link
link 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 need it. You can pass NULL in this parameter if you don't need the pointer
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if parent, name or dest are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.2

int iso_tree_add_node ( IsoImage image,
IsoDir parent,
const char *  path,
IsoNode **  node 
)

Add a new node to the image tree, from an existing file.

TODO comment Builder and Filesystem related issues when exposing both

All attributes will be taken from the source file. The appropriate file type will be created.

Parameters:
image The image
parent The directory in the image tree where the node will be added.
path The path of the file to add in the filesystem.
node 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 really need it. You can pass NULL in this parameter if you don't need the pointer.
Returns:
number of nodes in parent if success, < 0 otherwise Possible errors: ISO_NULL_POINTER, if image, parent or path are NULL ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists ISO_OUT_OF_MEM
Since:
0.6.2

int iso_tree_get_follow_symlinks ( IsoImage image  ) 

Get current setting for follow_symlinks.

See also:
iso_tree_set_follow_symlinks
Since:
0.6.2

int iso_tree_get_ignore_hidden ( IsoImage image  ) 

Get current setting for ignore_hidden.

See also:
iso_tree_set_ignore_hidden
Since:
0.6.2

int iso_tree_get_ignore_special ( IsoImage image  ) 

Get current setting for ignore_special.

See also:
iso_tree_set_ignore_special
Since:
0.6.2

char* iso_tree_get_node_path ( IsoNode node  ) 

Get the path on image of the given node.

Returns:
The path on the image, that must be freed when no more needed. If the given node is not added to any image, this returns NULL.
Since:
0.6.4

enum iso_replace_mode iso_tree_get_replace_mode ( IsoImage image  ) 

Get current setting for replace_mode.

See also:
iso_tree_set_replace_mode
Since:
0.6.2

int iso_tree_path_to_node ( IsoImage image,
const char *  path,
IsoNode **  node 
)

Locate a node by its path on image.

Parameters:
node Location for a pointer to the node, it will filled with NULL if the given path does not exists on image. The node will be owned by the image and shouldn't be unref(). Just call iso_node_ref() to get your own reference to the node. Note that you can pass NULL is the only thing you want to do is check if a node with such path really exists.
Returns:
1 found, 0 not found, < 0 error
Since:
0.6.2

int iso_tree_remove_exclude ( IsoImage image,
const char *  path 
)

Remove a previously added exclude.

See also:
iso_tree_add_exclude
Returns:
1 on success, 0 exclude do not exists, < 0 on error
Since:
0.6.2

void iso_tree_set_follow_symlinks ( IsoImage image,
int  follow 
)

Set whether to follow or not symbolic links when added a file from a source to IsoImage.

Default behavior is to not follow symlinks.

Since:
0.6.2

void iso_tree_set_ignore_hidden ( IsoImage image,
int  skip 
)

Set whether to skip or not hidden files when adding a directory recursibely.

Default behavior is to not ignore them, i.e., to add hidden files to image.

Since:
0.6.2

void iso_tree_set_ignore_special ( IsoImage image,
int  skip 
)

Set whether to skip or not special files.

Default behavior is to not skip them. Note that, despite of this setting, special files won't never be added to an image unless RR extensions were enabled.

Parameters:
skip Bitmask to determine what kind of special files will be skipped: bit0: ignore FIFOs bit1: ignore Sockets bit2: ignore char devices bit3: ignore block devices
Since:
0.6.2

void iso_tree_set_replace_mode ( IsoImage image,
enum iso_replace_mode  mode 
)

Set the replace mode, that defines the behavior of libisofs when adding a node whit the same name that an existent one, during a recursive directory addition.

Since:
0.6.2

void iso_tree_set_report_callback ( IsoImage image,
int(*)(IsoImage *, IsoFileSource *)  report 
)

Set a callback function that libisofs will call for each file that is added to the given image by a recursive addition function.

This includes image import.

Parameters:
report pointer to a function that will be called just before a file will be added to the image. You can control whether the file will be in fact added or ignored. This function should return 1 to add the file, 0 to ignore it and continue, < 0 to abort the process NULL is allowed if you don't want any callback.
Since:
0.6.2

void iso_write_opts_free ( IsoWriteOpts opts  ) 

Free an IsoWriteOpts previously allocated with iso_write_opts_new().

Since:
0.6.2

int iso_write_opts_new ( IsoWriteOpts **  opts,
int  profile 
)

Usage discussion:.

Some developers of the libburnia project have differing opinions how to ensure the compatibility of libaries and applications.

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 advises to use other means.

At compile time:

Vreixo Formoso advises to leave proper version matching to properly programmed checks in the the application's build system, which will eventually refuse compilation.

Thomas Schmitt advises to use the macros defined here for comparison with the application's requirements of library revisions and to eventually break compilation.

Both advises are combinable. I.e. be master of your build system and have if checks in the source code of your application, nevertheless.

At runtime (via iso_lib_is_compatible()):

Vreixo Formoso advises to compare the application's requirements of library revisions with the runtime library. This is to allow runtime libraries which are young enough for the application but too old for the lib*.h files seen at compile time.

Thomas Schmitt advises to compare the header revisions defined here with the runtime library. This is to enforce a strictly monotonous chain of revisions from app to header to library, at the cost of excluding some older libraries.

These two advises are mutually exclusive. Creates an IsoWriteOpts for writing an image. You should set the options desired with the correspondent setters.

Options by default are determined by the selected profile. Fifo size is set by default to 2 MB.

Parameters:
opts Pointer to the location where the newly created IsoWriteOpts will be stored. You should free it with iso_write_opts_free() when no more needed.
profile Default profile for image creation. For now the following values are defined: ---> 0 [BASIC] No extensions are enabled, and ISO level is set to 1. Only suitable for usage for very old and limited systems (like MS-DOS), or by a start point from which to set your custom options. ---> 1 [BACKUP] POSIX compatibility for backup. Simple settings, ISO level is set to 2 and RR extensions are enabled. Useful for backup purposes. ---> 2 [DISTRIBUTION] Setting for information distribution. Both RR and Joliet are enabled to maximize compatibility with most systems. Permissions are set to default values, and timestamps to the time of recording.
Returns:
1 success, < 0 error
Since:
0.6.2

int iso_write_opts_set_allow_deep_paths ( IsoWriteOpts opts,
int  allow 
)

Allow ISO-9660 directory hierarchy to be deeper than 8 levels.

This breaks ECMA-119 specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_allow_full_ascii ( IsoWriteOpts opts,
int  allow 
)

Allow all ASCII characters to be appear on an ISO-9660 filename.

Note that "/" and "\0" characters are never allowed, even in RR names. This breaks ECMA-119 specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_allow_longer_paths ( IsoWriteOpts opts,
int  allow 
)

Allow path in the ISO-9660 tree to have more than 255 characters.

This breaks ECMA-119 specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_allow_lowercase ( IsoWriteOpts opts,
int  allow 
)

Allow lowercase characters in ISO-9660 filenames.

By default, only uppercase characters, numbers and a few other characters are allowed. This breaks ECMA-119 specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_always_gmt ( IsoWriteOpts opts,
int  gmt 
)

Whether to always record timestamps in GMT.

By default, libisofs stores local time information on image. You can set this to always store timestamps in GMT. This is useful if you want to hide your timezone, or you live in a timezone that can't be represented in ECMA-119. These are timezones whose offset from GMT is greater than +13 hours, lower than -12 hours, or not a multiple of 15 minutes.

Since:
0.6.2

int iso_write_opts_set_appendable ( IsoWriteOpts opts,
int  appendable 
)

Set the type of the image to create.

Libisofs support two kind of images: stand-alone and appendable.

A stand-alone image is an image that is valid alone, and that can be mounted by its own. This is the kind of image you will want to create in most cases. A stand-alone image can be burned in an empty CD or DVD, or write to an .iso file for future burning or distribution.

On the other side, an appendable image is not self contained, it refers to serveral files that are stored outside the image. Its usage is for multisession discs, where you add data in a new session, while the previous session data can still be accessed. In those cases, the old data is not written again. Instead, the new image refers to it, and thus it's only valid when appended to the original. Note that in those cases the image will be written after the original, and thus you will want to use a ms_block greater than 0.

Note that if you haven't import a previous image (by means of iso_image_import()), the image will always be a stand-alone image, as there is no previous data to refer to.

Parameters:
appendable 1 to create an appendable image, 0 for an stand-alone one.
Since:
0.6.2

int iso_write_opts_set_default_dir_mode ( IsoWriteOpts opts,
mode_t  dir_mode 
)

Set the mode to use on dirs when you set the replace_mode of dirs to 2.

See also:
iso_write_opts_set_replace_mode
Since:
0.6.2

int iso_write_opts_set_default_file_mode ( IsoWriteOpts opts,
mode_t  file_mode 
)

Set the mode to use on files when you set the replace_mode of files to 2.

See also:
iso_write_opts_set_replace_mode
Since:
0.6.2

int iso_write_opts_set_default_gid ( IsoWriteOpts opts,
gid_t  gid 
)

Set the gid to use when you set the replace_gid to 2.

See also:
iso_write_opts_set_replace_mode
Since:
0.6.2

int iso_write_opts_set_default_timestamp ( IsoWriteOpts opts,
time_t  timestamp 
)

Set the timestamp to use when you set the replace_timestamps to 2.

See also:
iso_write_opts_set_replace_timestamps
Since:
0.6.2

int iso_write_opts_set_default_uid ( IsoWriteOpts opts,
uid_t  uid 
)

Set the uid to use when you set the replace_uid to 2.

See also:
iso_write_opts_set_replace_mode
Since:
0.6.2

int iso_write_opts_set_fifo_size ( IsoWriteOpts opts,
size_t  fifo_size 
)

Set the size, in number of blocks, of the FIFO buffer used between the writer thread and the burn_source.

You have to provide at least a 32 blocks buffer. Default value is set to 2MB, if that is ok for you, you don't need to call this function.

Since:
0.6.2

int iso_write_opts_set_iso1999 ( IsoWriteOpts opts,
int  enable 
)

Whether to use newer ISO-9660:1999 version.

This is the second version of ISO-9660. It allows longer filenames and has less restrictions than old ISO-9660. However, nobody is using it so there are no much reasons to enable this.

Since:
0.6.2

int iso_write_opts_set_iso_level ( IsoWriteOpts opts,
int  level 
)

Set the ISO-9960 level to write at.

Parameters:
level -> 1 for higher compatibility with old systems. With this level filenames are restricted to 8.3 characters. -> 2 to allow up to 31 filename characters.
Returns:
1 success, < 0 error
Since:
0.6.2

int iso_write_opts_set_joliet ( IsoWriteOpts opts,
int  enable 
)

Whether to add the non-standard Joliet extension to the image.

This extensions are heavily used in Microsoft Windows systems, so if you plan to use your disc on such a system you should add this extension. Usage of Joliet supplies longer filesystem length (up to 64 unicode characters), and deeper directory structure.

Parameters:
enable 1 to enable Joliet extension, 0 to not add them
Returns:
1 success, < 0 error
Since:
0.6.2

int iso_write_opts_set_joliet_longer_paths ( IsoWriteOpts opts,
int  allow 
)

Allow paths in the Joliet tree to have more than 240 characters.

This breaks Joliet specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_max_37_char_filenames ( IsoWriteOpts opts,
int  allow 
)

Allow a single file or directory hierarchy to have up to 37 characters.

This is larger than the 31 characters allowed by ISO level 2, and the extra space is taken from the version number, so this also forces omit_version_numbers. This breaks ECMA-119 specification and could lead to buffer overflow problems on old systems. Use with caution.

Since:
0.6.2

int iso_write_opts_set_ms_block ( IsoWriteOpts opts,
uint32_t  ms_block 
)

Set the start block of the image.

It is supposed to be the lba where the first block of the image will be written on disc. All references inside the ISO image will take this into account, thus providing a mountable image.

For appendable images, that are written to a new session, you should pass here the lba of the next writable address on disc.

In stand alone images this is usually 0. However, you may want to 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 image is written in a new session after some audio tracks.

Since:
0.6.2

int iso_write_opts_set_no_force_dots ( IsoWriteOpts opts,
int  no 
)

ISO-9660 forces filenames to have a ".", that separates file name from extension.

libisofs adds it if original filename doesn't has one. Set this to 1 to prevent this behavior. This breaks ECMA-119 specification. Use with caution.

Since:
0.6.2

int iso_write_opts_set_omit_version_numbers ( IsoWriteOpts opts,
int  omit 
)

Omit the version number (";1") at the end of the ISO-9660 identifiers.

This breaks ECMA-119 specification, but version numbers are usually not used, so it should work on most systems. Use with caution.

Since:
0.6.2

int iso_write_opts_set_output_charset ( IsoWriteOpts opts,
const char *  charset 
)

Set the charset to use for the RR names of the files that will be created on the image.

NULL to use default charset, that is the locale charset. You can obtain the list of charsets supported on your system executing "iconv -l" in a shell.

Since:
0.6.2

int iso_write_opts_set_overwrite_buf ( IsoWriteOpts opts,
uint8_t *  overwrite 
)

Sets the buffer where to store the descriptors which shall to be written at the beginning of an overwriteable media to point to the newly written image.

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 by the buffer content after the session was written and the buffer was updated by libisofs. Otherwise the new session would not be found by operating system function mount() or by libisoburn. (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 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.

Use cases:

  • 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. 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 on the same media. libisoburn emulates multisession appendability on overwriteable media and disk files by performing this use case.

  • Together with iso_write_opts_set_appendable(opts, 0) the buffer allows to write the first session on overwriteable media to start addresses other than 0. libisoburn in most cases writes the first session on overwriteable media and disk files to LBA 32 in order to preserve its descriptors from the subsequent overwriting by the descriptor buffer of later sessions.

Parameters:
buffer When not NULL, it should point to at least 64KiB of memory, where libisofs will install the contents that shall be written at the beginning of overwriteable media. 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, 0 is good enought.
Since:
0.6.2

int iso_write_opts_set_relaxed_vol_atts ( IsoWriteOpts opts,
int  allow 
)

Allow all characters to be part of Volume and Volset identifiers on the Primary Volume Descriptor.

This breaks ISO-9660 contraints, but should work on modern systems.

Since:
0.6.2

int iso_write_opts_set_replace_mode ( IsoWriteOpts opts,
int  dir_mode,
int  file_mode,
int  uid,
int  gid 
)

Whether to set default values for files and directory permissions, gid and uid.

All these take one of three values: 0, 1 or 2.

If 0, the corresponding attribute will be kept as setted in the IsoNode. Unless you have changed it, it corresponds to the value on disc, so it is suitable for backup purposes. If set to 1, the corresponding attrib. will be changed by a default suitable value. Finally, if you set it to 2, the attrib. will be changed with the value specified by the functioins below. Note that for mode attributes, only the permissions are set, the file type remains unchanged.

See also:
iso_write_opts_set_default_dir_mode

iso_write_opts_set_default_file_mode

iso_write_opts_set_default_uid

iso_write_opts_set_default_gid

Since:
0.6.2

int iso_write_opts_set_replace_timestamps ( IsoWriteOpts opts,
int  replace 
)

0 to use IsoNode timestamps, 1 to use recording time, 2 to use values from timestamp field.

This has only meaning if RR extensions are enabled.

See also:
iso_write_opts_set_default_timestamp
Since:
0.6.2

int iso_write_opts_set_rockridge ( IsoWriteOpts opts,
int  enable 
)

Whether to use or not Rock Ridge extensions.

This are standard extensions to ECMA-119, intended to add POSIX filesystem features to ECMA-119 images. Thus, usage of this flag is highly recommended for images used on GNU/Linux systems. With the usage of RR extension, the resulting image will have long filenames (up to 255 characters), deeper directory structure, POSIX permissions and owner info on files and directories, support for symbolic links or special files... All that attributes can be modified/setted with the appropiate function.

Parameters:
enable 1 to enable RR extension, 0 to not add them
Returns:
1 success, < 0 error
Since:
0.6.2

int iso_write_opts_set_sort_files ( IsoWriteOpts opts,
int  sort 
)

Whether to sort files based on their weight.

See also:
iso_node_set_sort_weight
Since:
0.6.2


Variable Documentation

unsigned int iso_fs_global_id

See IsoFilesystem->get_id() for info about this.

Since:
0.6.2

ino_t serial_id

Serial number to be used when you can't get a valid id for a Stream by other means.

If you use this, both fs_id and dev_id should be set to 0. This must be incremented each time you get a reference to it.

See also:
IsoStreamIface->get_id()
Since:
0.6.4


Generated on Wed Aug 6 12:55:38 2008 for libisofs by  doxygen 1.5.6