Main Page | Data Structures | Directories | File List | Data Fields | Globals

libtraceio.h File Reference

Internal IO compatibility shim. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define LIBTRACEIO_H   1

Typedefs

typedef libtrace_io_t libtrace_io_t

Functions

ssize_t libtrace_io_read (libtrace_io_t *io, void *buf, size_t len)
 read a block from a file
libtrace_io_t * libtrace_io_fdopen (int fd, const char *mode)
 open a file from a file descriptor (like fdopen(3))
libtrace_io_t * libtrace_io_open (const char *path, const char *mode)
 open a file from a path name
void libtrace_io_close (libtrace_io_t *io)
 close a file and free all of it's resources.
ssize_t libtrace_io_write (libtrace_io_t *io, const void *buf, size_t len)
 write a block of data to a file
int64_t libtrace_io_seek (libtrace_io_t *io, int64_t offset, int whence)
ssize_t libtrace_io_tell (libtrace_io_t *io)


Detailed Description

Internal IO compatibility shim.


Function Documentation

void libtrace_io_close libtrace_io_t *  io  ) 
 

close a file and free all of it's resources.

Parameters:
io io object
This function doesn't return anything. In theory it could return an error but seriously, if it did return an error, what would you do about it?

libtrace_io_t* libtrace_io_fdopen int  fd,
const char *  mode
 

open a file from a file descriptor (like fdopen(3))

Parameters:
fd file descriptor to read
mode text string to represent what mode to read the file in.
Returns:
io object, or NULL on error.

libtrace_io_t* libtrace_io_open const char *  path,
const char *  mode
 

open a file from a path name

Parameters:
path pathname to read
mode text string to represent what mode to read the file in.
Returns:
io object, or NULL on error.

ssize_t libtrace_io_read libtrace_io_t *  io,
void *  buf,
size_t  len
 

read a block from a file

Parameters:
io the io file object
buf the buffer to read into
len the number of bytes to read
Returns:
-1 on error (with errno set), 0 on eof, otherwise the number of bytes read.

ssize_t libtrace_io_write libtrace_io_t *  io,
const void *  buf,
size_t  len
 

write a block of data to a file

Parameters:
io libtrace io object to write to
buf buffer to write to
len number of bytes to write
Returns:
the number of bytes successfully written, or -1 on error with errno set


Generated on Mon Feb 12 11:44:01 2007 for WAND Trace processing by  doxygen 1.4.2