New API call iso_memory_stream_new(). (Was formely a private acll.)

This commit is contained in:
Thomas Schmitt 2011-01-01 14:55:26 +01:00
parent f923a79929
commit 8e2748f23b
3 changed files with 19 additions and 10 deletions

View File

@ -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"

View File

@ -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

View File

@ -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.