Data Fields

io_source_t Struct Reference

Structure defining a libtrace IO reader module. More...

Data Fields

const char * name
 Module name.
off_t(* read )(io_t *io, void *buffer, off_t len)
 Reads from the IO source into the provided buffer.
off_t(* peek )(io_t *io, void *buffer, off_t len)
 Reads from the IO source into the provided buffer but does not advance the read pointer.
off_t(* tell )(io_t *io)
 Returns the current offset of the read pointer for an IO source.
off_t(* seek )(io_t *io, off_t offset, int whence)
 Moves the read pointer for an IO source.
void(* close )(io_t *io)
 Closes an IO reader.

Detailed Description

Structure defining a libtrace IO reader module.


Field Documentation

void(* io_source_t::close)(io_t *io)

Closes an IO reader.

This function should free the IO reader.

Parameters:
io The IO reader to close

Referenced by wandio_destroy().

const char* io_source_t::name

Module name.

Referenced by wandio_peek(), and wandio_read().

off_t(* io_source_t::peek)(io_t *io, void *buffer, off_t len)

Reads from the IO source into the provided buffer but does not advance the read pointer.

Parameters:
io The IO reader
buffer The buffer to read into
len The amount of space available in the buffer
Returns:
The amount of bytes read, 0 if end of file is reached, -1 if an error occurs

Referenced by wandio_peek().

off_t(* io_source_t::read)(io_t *io, void *buffer, off_t len)

Reads from the IO source into the provided buffer.

Parameters:
io The IO reader
buffer The buffer to read into
len The amount of space available in the buffer
Returns:
The amount of bytes read, 0 if end of file is reached, -1 if an error occurs

Referenced by wandio_read().

off_t(* io_source_t::seek)(io_t *io, off_t offset, int whence)

Moves the read pointer for an IO source.

Parameters:
io The IO reader to move the read pointer for
offset The new read pointer offset
whence Where to start counting the new offset from. whence can be one of three values: SEEK_SET, SEEK_CUR and SEEK_END. See the lseek(2) manpage for more details as to what these mean.
Returns:
The value of the new read pointer, or -1 if an error occurs

Referenced by wandio_seek().

off_t(* io_source_t::tell)(io_t *io)

Returns the current offset of the read pointer for an IO source.

Parameters:
io The IO reader to get the read offset for
Returns:
The offset of the read pointer, or -1 if an error occurs

Referenced by wandio_tell().


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