diff --git a/libisofs/eltorito.c b/libisofs/eltorito.c index 3fb0a49..18ba318 100644 --- a/libisofs/eltorito.c +++ b/libisofs/eltorito.c @@ -12,8 +12,8 @@ #include "../config.h" #endif +#include "libisofs.h" #include "eltorito.h" -#include "stream.h" #include "fsource.h" #include "filesrc.h" #include "image.h" diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 331d669..f66243b 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -4026,6 +4026,24 @@ int iso_tree_add_new_dir(IsoDir *parent, const char *name, IsoDir **dir); int iso_tree_add_new_file(IsoDir *parent, const char *name, IsoStream *stream, IsoFile **file); +/** + * Create an IsoStream object from content which is stored in a dynamically + * allocated memory buffer. The new stream will become owner of the buffer + * and apply free() to it when the stream finally gets destroyed itself. + * + * @param buf + * The dynamically allocated memory buffer with the stream content. + * @parm size + * The number of bytes which may be read from buf. + * @param stream + * Will return a reference to the newly created stream. + * @return + * ISO_SUCCESS or <0 for error. E.g. ISO_NULL_POINTER, ISO_OUT_OF_MEM. + * + * @since 0.6.42 + */ +int iso_memory_stream_new(unsigned char *buf, size_t size, IsoStream **stream); + /** * 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 diff --git a/libisofs/stream.h b/libisofs/stream.h index 47f11c4..8bc43e0 100644 --- a/libisofs/stream.h +++ b/libisofs/stream.h @@ -55,15 +55,6 @@ int iso_file_source_stream_new(IsoFileSource *src, IsoStream **stream); int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size, IsoStream **stream); -/** - * Create a stream for reading from a arbitrary memory buffer. - * When the Stream refcount reach 0, the buffer is free(3). - * - * @return - * 1 sucess, < 0 error - */ -int iso_memory_stream_new(unsigned char *buf, size_t size, IsoStream **stream); - /** * Obtain eventual zisofs ZF field entry parameters from a file source out * of a loaded ISO image.