libburn/libisofs/libisofs.h

166 lines
4.7 KiB
C
Raw Normal View History

2006-08-15 20:37:04 +00:00
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* vim: set noet ts=8 sts=8 sw=8 : */
/**
* Create an ISO-9660 data volume with Rock Ridge and Joliet extensions.
* Usage is easy:
* - Create a new volume.
* - Add files and directories.
* - Write the volume to a file or create a burn source for use with Libburn.
*/
2006-08-24 19:23:37 +00:00
#ifndef LIBISO_LIBISOFS_H
#define LIBISO_LIBISOFS_H
2006-08-15 20:37:04 +00:00
2006-08-24 19:23:37 +00:00
/* #include <libburn.h> */
struct burn_source;
2006-08-15 20:37:04 +00:00
/**
* Data volume.
* @see volume.h for details.
*/
struct iso_volume;
/**
* A set of data volumes.
* @see volume.h for details.
*/
struct iso_volset;
/**
2006-08-24 19:23:37 +00:00
* A node in the filesystem tree.
2006-08-15 20:37:04 +00:00
* \see tree.h
*/
struct iso_tree_node;
enum ecma119_extension_flag {
ECMA119_ROCKRIDGE = (1<<0),
ECMA119_JOLIET = (1<<1)
};
/**
* Create a new volume.
* The parameters can be set to NULL if you wish to set them later.
*/
struct iso_volume *iso_volume_new(const char *volume_id,
const char *publisher_id,
const char *data_preparer_id);
2006-08-24 19:23:37 +00:00
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 *root);
2006-08-15 20:37:04 +00:00
/**
* Free a volume.
*/
void iso_volume_free(struct iso_volume *volume);
/**
* Get the root directory for a volume.
*/
2006-08-24 19:23:37 +00:00
struct iso_tree_node *iso_volume_get_root(const struct iso_volume *volume);
2006-08-15 20:37:04 +00:00
/**
* Fill in the volume identifier for a volume.
*/
void iso_volume_set_volume_id(struct iso_volume *volume,
const char *volume_id);
/**
* Fill in the publisher for a volume.
*/
void iso_volume_set_publisher_id(struct iso_volume *volume,
const char *publisher_id);
/**
* Fill in the data preparer for a volume.
*/
void iso_volume_set_data_preparer_id(struct iso_volume *volume,
const char *data_preparer_id);
/**
* Create a new Volume Set consisting of only one volume.
* @param volume The first and only volume for the volset to contain.
* @param volset_id The Volume Set ID.
* @return A new iso_volset.
*/
struct iso_volset *iso_volset_new(struct iso_volume *volume,
const char *volset_id);
/**
* Add a file to a directory.
*
* \param path The path, on the local filesystem, of the file.
*
2006-08-24 19:23:37 +00:00
* \pre \p parent is NULL or is a directory.
2006-08-15 20:37:04 +00:00
* \pre \p path is non-NULL and is a valid path to a non-directory on the local
* filesystem.
2006-08-24 19:23:37 +00:00
* \return An iso_tree_node whose path is \p path and whose parent is \p parent.
2006-08-15 20:37:04 +00:00
*/
2006-08-24 19:23:37 +00:00
struct iso_tree_node *iso_tree_add_node(struct iso_tree_node *parent,
2006-08-15 20:37:04 +00:00
const char *path);
/**
* 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 and iso_tree_add_dir.
*
* \param path The path, on the local filesystem, of the directory to add.
*
2006-08-24 19:23:37 +00:00
* \pre \p parent is NULL or is a directory.
2006-08-15 20:37:04 +00:00
* \pre \p path is non-NULL and is a valid path to a directory on the local
* filesystem.
* \return a pointer to the newly created directory.
*/
2006-08-24 19:23:37 +00:00
struct iso_tree_node *iso_tree_radd_dir(struct iso_tree_node *parent,
const char *path);
2006-08-15 20:37:04 +00:00
/**
* Creates a new, empty directory on the volume.
*
2006-08-24 19:23:37 +00:00
* \pre \p parent is NULL or is a directory.
2006-08-15 20:37:04 +00:00
* \pre \p name is unique among the children and files belonging to \p parent.
* Also, it doesn't contain '/' characters.
*
* \post \p parent contains a child directory whose name is \p name and whose
* POSIX attributes are the same as \p parent's.
* \return a pointer to the newly created directory.
*/
2006-08-24 19:23:37 +00:00
struct iso_tree_node *iso_tree_add_new_dir(struct iso_tree_node *parent,
const char *name);
2006-08-15 20:37:04 +00:00
/**
2006-08-24 19:23:37 +00:00
* Set the name of a file (using the current locale).
2006-08-15 20:37:04 +00:00
*/
2006-08-24 19:23:37 +00:00
void iso_tree_node_set_name(struct iso_tree_node *file, const char *name);
2006-08-15 20:37:04 +00:00
/**
* Recursively print a directory to stdout.
* \param spaces The initial number of spaces on the left. Set to 0 if you
* supply a root directory.
*/
2006-08-24 19:23:37 +00:00
void iso_tree_print(const struct iso_tree_node *root, int spaces);
2006-08-15 20:37:04 +00:00
/** 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.
*
* \param volumeset The volume set from which you want to write
* \param volnum The volume in the set which you want to write (usually 0)
* \param level ISO level to write at.
* \param flags Which extensions to support.
*
* \pre \p volumeset is non-NULL
* \pre \p volnum is less than \p volset->volset_size.
* \return A burn_source to be used for the data source for a track
*/
struct burn_source* iso_source_new_ecma119 (struct iso_volset *volumeset,
int volnum,
int level,
int flags);
2006-08-24 19:23:37 +00:00
#endif /* LIBISO_LIBISOFS_H */