Header file dealing with the Libtrace IO sub-system. More...
Go to the source code of this file.
Data Structures | |
struct | compression_type |
Structure defining a supported compression method. More... | |
struct | io_source_t |
Structure defining a libtrace IO reader module. More... | |
struct | iow_source_t |
Structure defining a libtrace IO writer module. More... | |
struct | io_t |
A libtrace IO reader. More... | |
struct | iow_t |
A libtrace IO writer. More... | |
Defines | |
#define | DLLEXPORT |
< Guard Define | |
#define | DLLLOCAL |
Typedefs | |
typedef struct io_t | io_t |
Opaque IO handle structure for reading. | |
typedef struct iow_t | iow_t |
Opaque IO handle structure for writing. | |
Enumerations | |
enum | { WANDIO_COMPRESS_NONE = 0, WANDIO_COMPRESS_ZLIB = 1, WANDIO_COMPRESS_BZ2 = 2, WANDIO_COMPRESS_LZO = 3, WANDIO_COMPRESS_MASK = 7 } |
Enumeration of all supported compression methods. More... | |
Functions | |
IO open functions | |
io_t * | bz_open (io_t *parent) |
io_t * | zlib_open (io_t *parent) |
io_t * | thread_open (io_t *parent) |
io_t * | peek_open (io_t *parent) |
io_t * | stdio_open (const char *filename) |
iow_t * | zlib_wopen (iow_t *child, int compress_level) |
iow_t * | bz_wopen (iow_t *child, int compress_level) |
iow_t * | lzo_wopen (iow_t *child, int compress_level) |
iow_t * | thread_wopen (iow_t *child) |
iow_t * | stdio_wopen (const char *filename, int fileflags) |
Libtrace IO API functions | |
io_t * | wandio_create (const char *filename) |
Creates a new libtrace IO reader and opens the provided file for reading. | |
off_t | wandio_tell (io_t *io) |
Returns the current offset of the read pointer for a libtrace IO reader. | |
off_t | wandio_seek (io_t *io, off_t offset, int whence) |
Changes the read pointer offset to the specified value for a libtrace IO reader. | |
off_t | wandio_read (io_t *io, void *buffer, off_t len) |
Reads from a libtrace IO reader into the provided buffer. | |
off_t | wandio_peek (io_t *io, void *buffer, off_t len) |
Reads from a libtrace IO reader into the provided buffer, but does not update the read pointer. | |
void | wandio_destroy (io_t *io) |
Destroys a libtrace IO reader, closing the file and freeing the reader structure. | |
iow_t * | wandio_wcreate (const char *filename, int compression_type, int compression_level, int flags) |
Creates a new libtrace IO writer and opens the provided file for writing. | |
off_t | wandio_wwrite (iow_t *iow, const void *buffer, off_t len) |
Writes the contents of a buffer using a libtrace IO writer. | |
void | wandio_wdestroy (iow_t *iow) |
Destroys a libtrace IO writer, closing the file and freeing the writer structure. | |
Variables | |
struct compression_type | compression_type [] |
The list of supported compression methods. | |
libtraceio options | |
int | force_directio_read |
int | force_directio_write |
uint64_t | write_waits |
uint64_t | read_waits |
unsigned int | use_threads |
unsigned int | max_buffers |
Header file dealing with the Libtrace IO sub-system.
#define DLLEXPORT |
< Guard Define
anonymous enum |
io_t* wandio_create | ( | const char * | filename | ) |
Creates a new libtrace IO reader and opens the provided file for reading.
filename | The name of the file to open |
This function will attempt to detect the compression format used for the given file (if any), provided that libtrace was built with the appropriate libraries.
void wandio_destroy | ( | io_t * | io | ) |
Destroys a libtrace IO reader, closing the file and freeing the reader structure.
io | The IO reader to destroy |
References io_source_t::close, and io_t::source.
off_t wandio_peek | ( | io_t * | io, | |
void * | buffer, | |||
off_t | len | |||
) |
Reads from a libtrace IO reader into the provided buffer, but does not update the read pointer.
io | The IO reader to read from | |
buffer | The buffer to read into | |
len | The size of the buffer |
References io_source_t::name, io_source_t::peek, and io_t::source.
off_t wandio_read | ( | io_t * | io, | |
void * | buffer, | |||
off_t | len | |||
) |
Reads from a libtrace IO reader into the provided buffer.
io | The IO reader to read from | |
buffer | The buffer to read into | |
len | The size of the buffer |
References io_source_t::name, io_source_t::read, and io_t::source.
off_t wandio_seek | ( | io_t * | io, | |
off_t | offset, | |||
int | whence | |||
) |
Changes the read pointer offset to the specified value for a libtrace IO reader.
io | The IO reader to adjust the read pointer for | |
offset | The new offset for the read pointer | |
whence | Indicates where to set the read pointer from. Can be one of SEEK_SET, SEEK_CUR or SEEK_END. |
The arguments for this function are the same as those for lseek(2). See the lseek(2) manpage for more details.
References io_source_t::seek, and io_t::source.
off_t wandio_tell | ( | io_t * | io | ) |
Returns the current offset of the read pointer for a libtrace IO reader.
io | The IO reader to get the read offset for |
References io_t::source, and io_source_t::tell.
iow_t* wandio_wcreate | ( | const char * | filename, | |
int | compression_type, | |||
int | compression_level, | |||
int | flags | |||
) |
Creates a new libtrace IO writer and opens the provided file for writing.
filename | The name of the file to open | |
compression_type | Compression type | |
compression_level | The compression level to use when writing | |
flags | Flags to apply when opening the file, e.g. O_CREATE |
References WANDIO_COMPRESS_BZ2, WANDIO_COMPRESS_LZO, WANDIO_COMPRESS_MASK, and WANDIO_COMPRESS_ZLIB.
void wandio_wdestroy | ( | iow_t * | iow | ) |
Destroys a libtrace IO writer, closing the file and freeing the writer structure.
iow | The IO writer to destroy |
References iow_source_t::close, and iow_t::source.
off_t wandio_wwrite | ( | iow_t * | iow, | |
const void * | buffer, | |||
off_t | len | |||
) |
Writes the contents of a buffer using a libtrace IO writer.
iow | The IO writer to write the data with | |
buffer | The buffer to write out | |
len | The amount of writable data in the buffer |
References iow_source_t::name, iow_t::source, and iow_source_t::write.
struct compression_type compression_type[] |
The list of supported compression methods.