|
|
|
@ -622,6 +622,26 @@ struct IsoFileSource_Iface
|
|
|
|
|
* Use iso_file_source_unref() instead.
|
|
|
|
|
*/
|
|
|
|
|
void (*free)(IsoFileSource *src);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Repositions the offset of the IsoFileSource (must be opened) to the
|
|
|
|
|
* given offset according to the value of flag.
|
|
|
|
|
*
|
|
|
|
|
* @param offset
|
|
|
|
|
* in bytes
|
|
|
|
|
* @param 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).
|
|
|
|
|
* @return
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
off_t (*lseek)(IsoFileSource *src, off_t offset, int flag);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* TODO #00004 Add a get_mime_type() function.
|
|
|
|
@ -2131,8 +2151,8 @@ void iso_dir_iter_free(IsoDirIter *iter);
|
|
|
|
|
* It's like iso_node_take(), but to be used during a directory iteration.
|
|
|
|
|
* The node removed will be the last returned by the iteration.
|
|
|
|
|
*
|
|
|
|
|
* The behavior on two call to this function without calling iso_dir_iter_next
|
|
|
|
|
* between then is undefined, and should never occur. (TODO protect against this?)
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* 1 on succes, < 0 error
|
|
|
|
@ -2150,8 +2170,8 @@ int iso_dir_iter_take(IsoDirIter *iter);
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* The behavior on two call to this function without calling iso_tree_iter_next
|
|
|
|
|
* between then is undefined, and should never occur. (TODO protect against this?)
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* 1 on succes, < 0 error
|
|
|
|
@ -2469,10 +2489,36 @@ 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);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
TODO #00007 expose Stream and this function:
|
|
|
|
|
int iso_tree_add_new_file(IsoDir *parent, const char *name, stream, 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.
|
|
|
|
|
*
|
|
|
|
|
* @param parent
|
|
|
|
|
* the dir where the new file will be created
|
|
|
|
|
* @param 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.
|
|
|
|
|
* @param 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.
|
|
|
|
|
* @param 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
|
|
|
|
|
* @return
|
|
|
|
|
* 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_file(IsoDir *parent, const char *name, IsoStream *stream,
|
|
|
|
|
IsoFile **file);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add a new symlink to the directory tree. Permissions are set to 0777,
|
|
|
|
@ -2760,6 +2806,44 @@ int iso_tree_add_node(IsoImage *image, IsoDir *parent, const char *path,
|
|
|
|
|
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. 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.
|
|
|
|
|
*
|
|
|
|
|
* @param image
|
|
|
|
|
* The image
|
|
|
|
|
* @param parent
|
|
|
|
|
* The directory in the image tree where the node will be added.
|
|
|
|
|
* @param name
|
|
|
|
|
* The name that the node will have on image.
|
|
|
|
|
* @param path
|
|
|
|
|
* The path of the file to add in the filesystem. For now only regular
|
|
|
|
|
* files and symlinks to regular files are supported.
|
|
|
|
|
* @param offset
|
|
|
|
|
* Offset on the given file from where to start reading data.
|
|
|
|
|
* @param size
|
|
|
|
|
* Max size of the file.
|
|
|
|
|
* @param 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.
|
|
|
|
|
* @return
|
|
|
|
|
* 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_cut_out_node(IsoImage *image, IsoDir *parent,
|
|
|
|
|
const char *name, const char *path,
|
|
|
|
|
off_t offset, off_t size,
|
|
|
|
|
IsoNode **node);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add the contents of a dir to a given directory of the iso tree.
|
|
|
|
|
*
|
|
|
|
@ -3190,6 +3274,25 @@ int iso_file_source_close(IsoFileSource *src);
|
|
|
|
|
*/
|
|
|
|
|
int iso_file_source_read(IsoFileSource *src, void *buf, size_t count);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Repositions the offset of the given IsoFileSource (must be opened) to the
|
|
|
|
|
* given offset according to the value of flag.
|
|
|
|
|
*
|
|
|
|
|
* @param offset
|
|
|
|
|
* in bytes
|
|
|
|
|
* @param 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).
|
|
|
|
|
* @return
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
off_t iso_file_source_lseek(IsoFileSource *src, off_t offset, int flag);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Read a directory.
|
|
|
|
|
*
|
|
|
|
@ -3575,10 +3678,16 @@ void iso_stream_get_id(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id,
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* File path break specification constraints and will be ignored
|
|
|
|
|
* (HINT,MEDIUM, -141)
|
|
|
|
|
* (HINT,MEDIUM, -144)
|
|
|
|
|
*/
|
|
|
|
|
#define ISO_FILE_IMGPATH_WRONG 0xC020FF70
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Offset greater than file size (FAILURE,HIGH, -145)
|
|
|
|
|
* @since 0.6.4
|
|
|
|
|
*/
|
|
|
|
|
#define ISO_FILE_OFFSET_TOO_BIG 0xE830FF6A
|
|
|
|
|
|
|
|
|
|
/** Charset conversion error (FAILURE,HIGH, -256) */
|
|
|
|
|
#define ISO_CHARSET_CONV_ERROR 0xE830FF00
|
|
|
|
|
|
|
|
|
|