#include <sys/types.h>
Go to the source code of this file.
Data Structures | |
struct | ecma119_source_opts |
Holds the options for the image generation. More... | |
struct | iso_tree_radd_dir_behavior |
Controls the bahavior of iso_tree_radd_dir function. More... | |
Defines | |
#define | INTERNAL_ERROR -1 |
#define | NO_FILE 1 |
#define | NO_READ_ACCESS 2 |
#define | UNEXPECTED_FILE_TYPE 3 |
#define | ELTORITO_WRONG_IMAGE_SIZE 4 |
Enumerations | |
enum | ecma119_extension_flag { ECMA119_ROCKRIDGE = (1<<0), ECMA119_JOLIET = (1<<1) } |
Extensions addition to ECMA-119 (ISO-9660) image. More... | |
enum | hide_node_flag { LIBISO_HIDE_ON_RR = 1 << 0, LIBISO_HIDE_ON_JOLIET = 1 << 1 } |
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 | ecma119_relaxed_constraints_flag { ECMA119_OMIT_VERSION_NUMBERS = (1<<0), ECMA119_37_CHAR_FILENAMES = (1<<1) | (1<<0), ECMA119_NO_DIR_REALOCATION = (1<<2), ECMA119_RELAXED_FILENAMES = (1<<3) } |
Functions | |
struct iso_volume * | iso_volume_new (const char *volume_id, const char *publisher_id, const char *data_preparer_id) |
Create a new volume. | |
struct iso_volume * | iso_volume_new_with_root (const char *volume_id, const char *publisher_id, const char *data_preparer_id, struct iso_tree_node_dir *root) |
void | iso_volume_free (struct iso_volume *volume) |
Free a volume. | |
void | iso_volset_free (struct iso_volset *volume) |
Free a set of data volumes. | |
struct iso_tree_node_dir * | iso_volume_get_root (const struct iso_volume *volume) |
Get the root directory for a volume. | |
void | iso_volume_set_volume_id (struct iso_volume *volume, const char *volume_id) |
Fill in the volume identifier for a volume. | |
void | iso_volume_set_publisher_id (struct iso_volume *volume, const char *publisher_id) |
Fill in the publisher for a volume. | |
void | iso_volume_set_data_preparer_id (struct iso_volume *volume, const char *data_preparer_id) |
Fill in the data preparer for a volume. | |
void | iso_volume_set_system_id (struct iso_volume *volume, const char *system_id) |
Fill in the system id for a volume. | |
void | iso_volume_set_application_id (struct iso_volume *volume, const char *application_id) |
Fill in the application id for a volume. | |
void | iso_volume_set_copyright_file_id (struct iso_volume *volume, const char *copyright_file_id) |
Fill copyright information for the volume. | |
void | iso_volume_set_abstract_file_id (struct iso_volume *volume, const char *abstract_file_id) |
Fill abstract information for the volume. | |
void | iso_volume_set_biblio_file_id (struct iso_volume *volume, const char *biblio_file_id) |
Fill biblio information for the volume. | |
struct el_torito_boot_image * | iso_volume_create_boot_catalog (struct iso_volume *volume, struct iso_tree_node *image, enum eltorito_boot_media_type type, struct iso_tree_node_dir *dir, char *name) |
Create a bootable volume by adding a El-Torito boot image. | |
void | el_torito_set_load_seg (struct el_torito_boot_image *bootimg, int segment) |
Sets the load segment for the initial boot image. | |
void | el_torito_set_load_size (struct el_torito_boot_image *bootimg, int sectors) |
Sets the number of sectors (512b) to be load at load segment during the initial boot procedure. | |
void | el_torito_set_no_bootable (struct el_torito_boot_image *bootimg) |
Marks the specified boot image as not bootable. | |
void | el_torito_set_write_boot_info (struct el_torito_boot_image *bootimg) |
Specifies that this image needs to be patched. | |
struct iso_tree_node * | iso_tree_volume_path_to_node (struct iso_volume *volume, const char *path) |
Locate a node by its path on disc. | |
struct iso_volset * | iso_volset_new (struct iso_volume *volume, const char *volset_id) |
Add a file or a directory (recursively) to a volume by specifying its path on the volume. | |
struct iso_tree_node_dir * | iso_tree_new_root () |
Creates a new root dir for a filesystem tree. | |
struct iso_tree_node * | iso_tree_add_file (struct iso_tree_node_dir *parent, const char *path) |
Add a file to a directory. | |
struct iso_tree_node * | iso_tree_add_symlink (struct iso_tree_node_dir *parent, const char *name, const char *dest) |
Add a symbolic link to a directory. | |
struct iso_tree_node_dir * | iso_tree_add_dir (struct iso_tree_node_dir *parent, const char *name) |
Add a new, empty directory to the tree. | |
struct iso_tree_node * | iso_tree_add_node (struct iso_tree_node_dir *parent, const char *path) |
Add a file to a directory. | |
void | iso_tree_radd_dir (struct iso_tree_node_dir *parent, const char *path, struct iso_tree_radd_dir_behavior *behavior) |
Recursively add an existing directory to the tree. | |
void | iso_tree_node_set_name (struct iso_tree_node *node, const char *name) |
Set the name of a tree node (using the current locale). | |
void | iso_tree_node_set_hidden (struct iso_tree_node *node, int hide_attrs) |
Set if the node will be hidden in RR/ISO tree, Joliet tree or both. | |
void | iso_tree_node_set_gid (struct iso_tree_node *node, gid_t gid) |
Set the group id for the node. | |
void | iso_tree_node_set_uid (struct iso_tree_node *node, uid_t uid) |
Set the user id for the node. | |
void | iso_tree_node_set_permissions (struct iso_tree_node *node, mode_t mode) |
Set the permissions for the node. | |
void | iso_tree_node_set_sort_weight (struct iso_tree_node *node, int w) |
Sets the order in which a node will be written on image. | |
void | iso_tree_print (const struct iso_tree_node *root, int spaces) |
Recursively print a directory to stdout. | |
struct burn_source * | iso_source_new_ecma119 (struct iso_volset *volumeset, struct ecma119_source_opts *opts) |
Create a burn_source which can be used as a data source for a track. | |
Variables | |
int | libisofs_errno |
This will hold the error code for some functions, if them fail. |
#define ELTORITO_WRONG_IMAGE_SIZE 4 |
Definition at line 174 of file libisofs.h.
#define INTERNAL_ERROR -1 |
Definition at line 166 of file libisofs.h.
#define NO_FILE 1 |
Definition at line 168 of file libisofs.h.
#define NO_READ_ACCESS 2 |
Definition at line 170 of file libisofs.h.
#define UNEXPECTED_FILE_TYPE 3 |
Definition at line 172 of file libisofs.h.
Extensions addition to ECMA-119 (ISO-9660) image.
Usage of at least one of these flags is highly recommended if the disc will be used on a modern OS.
Definition at line 56 of file libisofs.h.
00056 { 00057 /** 00058 * Add the standard Rock Ridge extensions. This adds POSIX filesystem 00059 * features to the ECMA-119 image. Thus, usage of this flag is highly 00060 * recommended for images used on GNU/Linux systems. With the usage 00061 * of RR extension, the resulting image will have long filenames (up to 00062 * 255 characters), deeper directory structure, POSIX permissions and 00063 * owner info on files and directories, support for symbolic links or 00064 * special files... All that attributes can be modified/setted with the 00065 * appropiate function. 00066 */ 00067 ECMA119_ROCKRIDGE = (1<<0), 00068 /** 00069 * Add the non-standard Joliet extension to the image. This extension is 00070 * heavily used in Microsoft Windows systems, so if you plan to use your 00071 * disc on such a system you should add this extension. Usage of Joliet 00072 * supplies longer filesystem length (up to 64 unicode characters), and 00073 * deeper directory structure. 00074 */ 00075 ECMA119_JOLIET = (1<<1) 00076 };
ECMA119_OMIT_VERSION_NUMBERS | |
ECMA119_37_CHAR_FILENAMES | |
ECMA119_NO_DIR_REALOCATION | |
ECMA119_RELAXED_FILENAMES |
Definition at line 97 of file libisofs.h.
00097 { 00098 ECMA119_OMIT_VERSION_NUMBERS = (1<<0), 00099 /* 37 char filenames involves no version number */ 00100 ECMA119_37_CHAR_FILENAMES = (1<<1) | (1<<0), 00101 ECMA119_NO_DIR_REALOCATION = (1<<2), 00102 ECMA119_RELAXED_FILENAMES = (1<<3) 00103 };
El-Torito bootable image type.
Definition at line 91 of file libisofs.h.
00091 { 00092 ELTORITO_FLOPPY_EMUL, 00093 ELTORITO_HARD_DISC_EMUL, 00094 ELTORITO_NO_EMUL 00095 };
enum hide_node_flag |
Flag used to hide a file in the RR/ISO or Joliet tree.
Definition at line 83 of file libisofs.h.
00083 { 00084 LIBISO_HIDE_ON_RR = 1 << 0, 00085 LIBISO_HIDE_ON_JOLIET = 1 << 1 00086 };
void el_torito_set_load_seg | ( | struct el_torito_boot_image * | bootimg, | |
int | 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.
void el_torito_set_load_size | ( | struct el_torito_boot_image * | bootimg, | |
int | 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.
void el_torito_set_no_bootable | ( | struct el_torito_boot_image * | bootimg | ) |
Marks the specified boot image as not bootable.
void el_torito_set_write_boot_info | ( | struct el_torito_boot_image * | 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. Be aware that libisofs will modify original boot image file, so do a backup if needed. This is needed for isolinux boot images.
struct burn_source* iso_source_new_ecma119 | ( | struct iso_volset * | volumeset, | |
struct ecma119_source_opts * | opts | |||
) | [read] |
Create a burn_source which can be used as a data source for a track.
The volume set used to create the libburn_source can _not_ be modified until the libburn_source is freed.
volumeset | The volume set from which you want to write | |
opts | The options for image generation |
volumeset
is non-NULL
volnum
is less than volset->volset_size
.
struct iso_tree_node_dir* iso_tree_add_dir | ( | struct iso_tree_node_dir * | parent, | |
const char * | name | |||
) | [read] |
Add a new, empty directory to the tree.
parent
is non-NULL.
name
is unique among the children and files belonging to parent
. Also, it doesn't contain '/' characters.
parent
contains a child directory whose name is name
and whose POSIX attributes are the same as parent's
. struct iso_tree_node* iso_tree_add_file | ( | struct iso_tree_node_dir * | parent, | |
const char * | path | |||
) | [read] |
Add a file to a directory.
path | The path, on the local filesystem, of the file. |
parent
is non-NULL.
path
is non-NULL.
path
and whose parent is parent
. On error, returns NULL and libisofs_errno is set appropriately: NO_FILE if path doesn't point to a valid file. NO_READ_ACCESS if user haven't read access on file UNEXPECTED_FILE_TYPE if path doesn't point to a regular file struct iso_tree_node* iso_tree_add_node | ( | struct iso_tree_node_dir * | parent, | |
const char * | path | |||
) | [read] |
Add a file to a directory.
path | The path, on the local filesystem, of the file. |
parent
is non-NULL.
path
is non-NULL and is a valid path to a file or directory on the local filesystem.
path
and whose parent is parent
. On error, returns NULL and libisofs_errno is set appropriately: NO_FILE if path doesn't point to a valid file. NO_READ_ACCESS if user haven't read access on file UNEXPECTED_FILE_TYPE if path refers to non supported file type (at the momment, only dirs, symlinks and regular files are supported). struct iso_tree_node* iso_tree_add_symlink | ( | struct iso_tree_node_dir * | parent, | |
const char * | name, | |||
const char * | dest | |||
) | [read] |
Add a symbolic link to a directory.
name | The name of the symbolic link | |
dest | The distination of the link, i.e., the file this link points to |
parent
, name and dest are non-NULL.struct iso_tree_node_dir* iso_tree_new_root | ( | ) | [read] |
Creates a new root dir for a filesystem tree.
void iso_tree_node_set_gid | ( | struct iso_tree_node * | node, | |
gid_t | gid | |||
) |
Set the group id for the node.
This attribute is only useful when Rock Ridge extensions are enabled.
void iso_tree_node_set_hidden | ( | struct iso_tree_node * | 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.
node | The node that is to be hidden. | |
hide_attrs | hide_node_flag's to set the trees in which file will be hidden. |
void iso_tree_node_set_name | ( | struct iso_tree_node * | node, | |
const char * | name | |||
) |
Set the name of a tree node (using the current locale).
void iso_tree_node_set_permissions | ( | struct iso_tree_node * | node, | |
mode_t | mode | |||
) |
Set the permissions for the node.
This attribute is only useful when Rock Ridge extensions are enabled.
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. |
void iso_tree_node_set_sort_weight | ( | struct iso_tree_node * | 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.
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. |
void iso_tree_node_set_uid | ( | struct iso_tree_node * | node, | |
uid_t | uid | |||
) |
Set the user id for the node.
This attribute is only useful when Rock Ridge extensions are enabled.
void iso_tree_print | ( | const struct iso_tree_node * | root, | |
int | spaces | |||
) |
Recursively print a directory to stdout.
spaces | The initial number of spaces on the left. Set to 0 if you supply a root directory. |
void iso_tree_radd_dir | ( | struct iso_tree_node_dir * | parent, | |
const char * | path, | |||
struct iso_tree_radd_dir_behavior * | behavior | |||
) |
Recursively add an existing directory to the tree.
Warning: when using this, you'll lose pointers to files or subdirectories. If you want to have pointers to all files and directories, use iso_tree_add_file, iso_tree_add_node and iso_tree_add_dir.
path | The path, on the local filesystem, of the directory to add. |
parent
is non-NULL.
path
is non-NULL and is a valid path to a directory on the local filesystem.
struct iso_tree_node* iso_tree_volume_path_to_node | ( | struct iso_volume * | volume, | |
const char * | path | |||
) | [read] |
Locate a node by its path on disc.
volume | The volume to search in. | |
path | The path, in the image, of the file. |
void iso_volset_free | ( | struct iso_volset * | volume | ) |
Free a set of data volumes.
struct iso_volset* iso_volset_new | ( | struct iso_volume * | volume, | |
const char * | volset_id | |||
) | [read] |
Add a file or a directory (recursively) to a volume by specifying its path on the volume.
volume | The volume to add the file to. | |
disc_path | The path on the disc at which to add the disc. | |
path | The path, on the local filesystem, of the file. |
volume | The volume to add the directory to. | |
disc_path | The path on the volume at which to add the directory. |
volume | The first and only volume for the volset to contain. | |
volset_id | The Volume Set ID. |
struct el_torito_boot_image* iso_volume_create_boot_catalog | ( | struct iso_volume * | volume, | |
struct iso_tree_node * | image, | |||
enum eltorito_boot_media_type | type, | |||
struct iso_tree_node_dir * | dir, | |||
char * | name | |||
) | [read] |
Create a bootable volume by adding a El-Torito boot image.
volume | The volume to make bootable. | |
image | The tree node with the file to use as default boot image. | |
type | The boot media type. This can be one of 3 types:
|
dir | The directory node where the boot catalog will be located in image. Usually both boot catalog and boot image will be located in the same dir, maybe /boot. | |
name | The name of the boot catalog. |
volume
is a volume without any boot catalog yet
image
is a file tree node already inserted in the volume tree.
dir
is a directory node already inserted in the volume tree.
name
There isn't any dir child with the same name.
void iso_volume_free | ( | struct iso_volume * | volume | ) |
Free a volume.
struct iso_tree_node_dir* iso_volume_get_root | ( | const struct iso_volume * | volume | ) | [read] |
Get the root directory for a volume.
struct iso_volume* iso_volume_new | ( | const char * | volume_id, | |
const char * | publisher_id, | |||
const char * | data_preparer_id | |||
) | [read] |
Create a new volume.
The parameters can be set to NULL if you wish to set them later.
struct iso_volume* iso_volume_new_with_root | ( | const char * | volume_id, | |
const char * | publisher_id, | |||
const char * | data_preparer_id, | |||
struct iso_tree_node_dir * | root | |||
) | [read] |
void iso_volume_set_abstract_file_id | ( | struct iso_volume * | volume, | |
const char * | abstract_file_id | |||
) |
Fill abstract information for the volume.
Usually this refers to a file on disc. Up to 37 characters.
void iso_volume_set_application_id | ( | struct iso_volume * | volume, | |
const char * | application_id | |||
) |
Fill in the application id for a volume.
Up to 128 chars.
void iso_volume_set_biblio_file_id | ( | struct iso_volume * | volume, | |
const char * | biblio_file_id | |||
) |
Fill biblio information for the volume.
Usually this refers to a file on disc. Up to 37 characters.
void iso_volume_set_copyright_file_id | ( | struct iso_volume * | volume, | |
const char * | copyright_file_id | |||
) |
Fill copyright information for the volume.
Usually this refers to a file on disc. Up to 37 characters.
void iso_volume_set_data_preparer_id | ( | struct iso_volume * | volume, | |
const char * | data_preparer_id | |||
) |
Fill in the data preparer for a volume.
void iso_volume_set_publisher_id | ( | struct iso_volume * | volume, | |
const char * | publisher_id | |||
) |
Fill in the publisher for a volume.
void iso_volume_set_system_id | ( | struct iso_volume * | volume, | |
const char * | system_id | |||
) |
Fill in the system id for a volume.
Up to 32 characters.
void iso_volume_set_volume_id | ( | struct iso_volume * | volume, | |
const char * | volume_id | |||
) |
Fill in the volume identifier for a volume.
int libisofs_errno |
This will hold the error code for some functions, if them fail.
Definition at line 163 of file libisofs.h.