xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

IsoStream_Iface Struct Reference

#include <libisofs.h>

Collaboration diagram for IsoStream_Iface:
[legend]

Data Fields

int version
 
char type [4]
 
int(* open )(IsoStream *stream)
 
int(* close )(IsoStream *stream)
 
off_t(* get_size )(IsoStream *stream)
 
int(* read )(IsoStream *stream, void *buf, size_t count)
 
int(* is_repeatable )(IsoStream *stream)
 
void(* get_id )(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id)
 
void(* free )(IsoStream *stream)
 
int(* update_size )(IsoStream *stream)
 
IsoStream *(* get_input_stream )(IsoStream *stream, int flag)
 
int(* cmp_ino )(IsoStream *s1, IsoStream *s2)
 
int(* clone_stream )(IsoStream *old_stream, IsoStream **new_stream, int flag)
 

Detailed Description

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.

Since
0.6.4

Definition at line 984 of file libisofs.h.

Field Documentation

◆ clone_stream

int(* IsoStream_Iface::clone_stream) (IsoStream *old_stream, IsoStream **new_stream, int flag)

Produce a copy of a stream. It must be possible to operate both stream objects concurrently.

Parameters
old_streamThe existing stream object to be copied
new_streamWill return a pointer to the copy
flagBitfield for control purposes. 0 means normal behavior. The function shall return ISO_STREAM_NO_CLONE on unknown flag bits.
Returns
1 in case of success, or an error code < 0
Since
1.0.2 Present if .version is 4 or higher.

Definition at line 1170 of file libisofs.h.

Referenced by iso_stream_clone().

◆ close

int(* IsoStream_Iface::close) (IsoStream *stream)

Close the Stream.

Returns
1 on success, < 0 on error (has to be a valid libisofs error code)

Definition at line 1032 of file libisofs.h.

Referenced by iso_stream_close().

◆ cmp_ino

int(* IsoStream_Iface::cmp_ino) (IsoStream *s1, IsoStream *s2)

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.

A pointer value of NULL is permissible. In this case, function iso_stream_cmp_ino() will decide on its own.

If not NULL, this function .cmp_ino() will be called by iso_stream_cmp_ino() if both compared streams point to it, and if not flag bit0 of iso_stream_cmp_ino() prevents it. So a .cmp_ino() function must be able to compare any pair of streams which name it as their .cmp_ino(). A fallback to iso_stream_cmp_ino(,,1) would endanger transitivity of iso_stream_cmp_ino(,,0).

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 Most tricky is the demand for transitivity: if cmp_ino(A,B) < 0 && cmp_ino(B,C) < 0 then cmp_ino(A,C) < 0

Parameters
s1The first stream to compare. Expect foreign stream types.
s2The second stream to compare. Expect foreign stream types.
Returns
-1 if s1 is smaller s2 , 0 if s1 matches s2 , 1 if s1 is larger s2
Since
0.6.20 Present if .version is 3 or higher.

Definition at line 1151 of file libisofs.h.

Referenced by iso_stream_cmp_ino().

◆ free

void(* IsoStream_Iface::free) (IsoStream *stream)

Free implementation specific data. Should never be called by user. Use iso_stream_unref() instead.

Definition at line 1078 of file libisofs.h.

Referenced by iso_stream_unref().

◆ get_id

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 1071 of file libisofs.h.

Referenced by iso_stream_get_id().

◆ get_input_stream

IsoStream*(* IsoStream_Iface::get_input_stream) (IsoStream *stream, int flag)

Retrieve the eventual input stream of a filter stream.

Parameters
streamThe eventual filter stream to be inquired.
flagBitfield for control purposes. 0 means normal behavior.
Returns
The input stream, if one exists. Elsewise NULL. No extra reference to the stream shall be taken by this call.
Since
0.6.18 Present if .version is 2 or higher.

Definition at line 1111 of file libisofs.h.

◆ get_size

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 1039 of file libisofs.h.

Referenced by extf_stream_open_flag(), gzip_stream_open_flag(), iso_stream_get_size(), and ziso_stream_open_flag().

◆ is_repeatable

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.

Returns
1 if stream is repeatable, 0 if not, < 0 on error (has to be a valid libisofs error code)

Definition at line 1066 of file libisofs.h.

Referenced by iso_stream_is_repeatable().

◆ open

int(* IsoStream_Iface::open) (IsoStream *stream)

Opens the stream.

Returns
1 on success, 2 file greater than expected, 3 file smaller than expected, < 0 on error (has to be a valid libisofs error code)

Definition at line 1025 of file libisofs.h.

Referenced by iso_stream_open().

◆ read

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.

Returns
number of bytes read, 0 if EOF, < 0 on error (has to be a valid libisofs error code)

Definition at line 1055 of file libisofs.h.

Referenced by gzip_stream_close_flag(), gzip_stream_free(), gzip_stream_get_size(), gzip_stream_open_flag(), iso_stream_read(), ziso_clone_stream(), ziso_discard_bpt(), ziso_stream_close_flag(), ziso_stream_free(), ziso_stream_measure_size(), and ziso_stream_open_flag().

◆ type

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 1016 of file libisofs.h.

Referenced by iso_file_get_old_image_sections(), iso_node_zf_by_magic(), iso_stream_get_file_name(), Xorriso_restore_is_identical(), Xorriso_set_filter(), and Xorriso_stream_type().

◆ update_size

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()).

Returns
1 if ok, < 0 on error (has to be a valid libisofs error code)
Since
0.6.8 Present if .version is 1 or higher.

Definition at line 1095 of file libisofs.h.

◆ version

int IsoStream_Iface::version

Definition at line 1001 of file libisofs.h.

Referenced by iso_stream_clone(), and iso_stream_cmp_ino().


The documentation for this struct was generated from the following file: