2007-11-24 15:58:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Vreixo Formoso
|
|
|
|
*
|
|
|
|
* This file is part of the libisofs project; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation. See COPYING file for details.
|
|
|
|
*/
|
|
|
|
#ifndef LIBISO_STREAM_H_
|
|
|
|
#define LIBISO_STREAM_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Definitions of streams.
|
|
|
|
*/
|
2007-12-02 21:04:26 +00:00
|
|
|
#include "fsource.h"
|
2007-11-26 23:27:57 +00:00
|
|
|
|
2008-02-23 17:03:12 +00:00
|
|
|
/* TODO consider removing this header */
|
2008-01-10 16:56:39 +00:00
|
|
|
|
2007-11-24 15:58:36 +00:00
|
|
|
/*
|
|
|
|
* Some functions here will be moved to libisofs.h when we expose
|
|
|
|
* Streams.
|
|
|
|
*/
|
|
|
|
|
2007-12-02 21:04:26 +00:00
|
|
|
/**
|
|
|
|
* Create a stream to read from a IsoFileSource.
|
|
|
|
* The stream will take the ref. to the IsoFileSource, so after a successfully
|
|
|
|
* exectution of this function, you musn't unref() the source, unless you
|
|
|
|
* take an extra ref.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* 1 sucess, < 0 error
|
|
|
|
* Possible errors:
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int iso_file_source_stream_new(IsoFileSource *src, IsoStream **stream);
|
|
|
|
|
2008-01-11 15:42:18 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2007-11-24 15:58:36 +00:00
|
|
|
#endif /*STREAM_H_*/
|