libisofs
1.3.4
|
Interface definition for IsoStream methods. More...
#include <libisofs.h>
Data Fields | |
int | version |
char | type [4] |
Type of Stream. More... | |
int(* | open )(IsoStream *stream) |
Opens the stream. More... | |
int(* | close )(IsoStream *stream) |
Close the Stream. More... | |
off_t(* | get_size )(IsoStream *stream) |
Get the size (in bytes) of the stream. More... | |
int(* | read )(IsoStream *stream, void *buf, size_t count) |
Attempt to read up to count bytes from the given stream into the buffer starting at buf. More... | |
int(* | is_repeatable )(IsoStream *stream) |
Tell whether this IsoStream can be read several times, with the same results. More... | |
void(* | get_id )(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id) |
Get an unique identifier for the IsoStream. More... | |
void(* | free )(IsoStream *stream) |
Free implementation specific data. More... | |
int(* | update_size )(IsoStream *stream) |
Update the size of the IsoStream with the current size of the underlying source, if the source is prone to size changes. More... | |
IsoStream *(* | get_input_stream )(IsoStream *stream, int flag) |
Retrieve the eventual input stream of a filter stream. More... | |
int(* | cmp_ino )(IsoStream *s1, IsoStream *s2) |
Compare two streams whether they are based on the same input and will produce the same output. More... | |
int(* | clone_stream )(IsoStream *old_stream, IsoStream **new_stream, int flag) |
Produce a copy of a stream. More... | |
Interface definition for IsoStream methods.
It is public to allow implementation of own stream types. The methods defined here typically make use of stream.data which points to the individual state data of stream instances.
Definition at line 970 of file libisofs.h.
Produce a copy of a stream.
It must be possible to operate both stream objects concurrently.
old_stream | The existing stream object to be copied |
new_stream | Will return a pointer to the copy |
flag | Bitfield for control purposes. 0 means normal behavior. The function shall return ISO_STREAM_NO_CLONE on unknown flag bits. |
Definition at line 1159 of file libisofs.h.
int(* IsoStream_Iface::close)(IsoStream *stream) |
Close the Stream.
Definition at line 1018 of file libisofs.h.
Compare two streams whether they are based on the same input and will produce the same output.
If in any doubt, then this comparison should indicate no match. A match might allow hardlinking of IsoFile objects.
If this function cannot accept one of the given stream types, then the decision must be delegated to iso_stream_cmp_ino(s1, s2, 1); This is also appropriate if one has reason to implement stream.cmp_ino() without having an own special comparison algorithm.
With filter streams, the decision whether the underlying chains of streams match, should be delegated to iso_stream_cmp_ino(iso_stream_get_input_stream(s1, 0), iso_stream_get_input_stream(s2, 0), 0);
The stream.cmp_ino() function has to establish an equivalence and order relation: cmp_ino(A,A) == 0 cmp_ino(A,B) == -cmp_ino(B,A) if cmp_ino(A,B) == 0 && cmp_ino(B,C) == 0 then cmp_ino(A,C) == 0 if cmp_ino(A,B) < 0 && cmp_ino(B,C) < 0 then cmp_ino(A,C) < 0
A big hazard to the last constraint are tests which do not apply to some types of streams.Thus it is mandatory to let iso_stream_cmp_ino(s1,s2,1) decide in this case.
A function s1.(*cmp_ino)() must only accept stream s2 if function s2.(*cmp_ino)() would accept s1. Best is to accept only the own stream type or to have the same function for a family of similar stream types.
s1 | The first stream to compare. Expect foreign stream types. |
s2 | The second stream to compare. Expect foreign stream types. |
Definition at line 1140 of file libisofs.h.
void(* IsoStream_Iface::free)(IsoStream *stream) |
Free implementation specific data.
Should never be called by user. Use iso_stream_unref() instead.
Definition at line 1064 of file libisofs.h.
void(* IsoStream_Iface::get_id)(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id) |
Get an unique identifier for the IsoStream.
Definition at line 1057 of file libisofs.h.
Retrieve the eventual input stream of a filter stream.
stream | The eventual filter stream to be inquired. |
flag | Bitfield for control purposes. 0 means normal behavior. |
Definition at line 1097 of file libisofs.h.
off_t(* IsoStream_Iface::get_size)(IsoStream *stream) |
Get the size (in bytes) of the stream.
This function should always return the same size, even if the underlying source size changes, unless you call update_size() method.
Definition at line 1025 of file libisofs.h.
int(* IsoStream_Iface::is_repeatable)(IsoStream *stream) |
Tell whether this IsoStream can be read several times, with the same results.
For example, a regular file is repeatable, you can read it as many times as you want. However, a pipe is not.
Definition at line 1052 of file libisofs.h.
int(* IsoStream_Iface::open)(IsoStream *stream) |
Opens the stream.
Definition at line 1011 of file libisofs.h.
int(* IsoStream_Iface::read)(IsoStream *stream, void *buf, size_t count) |
Attempt to read up to count bytes from the given stream into the buffer starting at buf.
The implementation has to make sure that either the full desired count of bytes is delivered or that the next call to this function will return EOF or error. I.e. only the last read block may be shorter than parameter count.
The stream must be open() before calling this, and close() when no more needed.
Definition at line 1041 of file libisofs.h.
char IsoStream_Iface::type[4] |
Type of Stream.
"fsrc" -> Read from file source "cout" -> Cut out interval from disk file "mem " -> Read from memory "boot" -> Boot catalog "extf" -> External filter program "ziso" -> zisofs compression "osiz" -> zisofs uncompression "gzip" -> gzip compression "pizg" -> gzip uncompression (gunzip) "user" -> User supplied stream
Definition at line 1002 of file libisofs.h.
int(* IsoStream_Iface::update_size)(IsoStream *stream) |
Update the size of the IsoStream with the current size of the underlying source, if the source is prone to size changes.
After calling this, get_size() shall eventually return the new size. This will never be called after iso_image_create_burn_source() was called and before the image was completely written. (The API call to update the size of all files in the image is iso_image_update_sizes()).
Definition at line 1081 of file libisofs.h.
int IsoStream_Iface::version |
Definition at line 987 of file libisofs.h.