Wheefun I/O Library  0.0.5
Useful I/O Primitives.
Public Attributes | List of all members
wfio_device_vtable_t Struct Reference

The virtual table for a wfio_device_t. More...

#include <device.h>

Collaboration diagram for wfio_device_vtable_t:
Collaboration graph
[legend]

Public Attributes

void(* close )(struct wfio_device_t *dev)
 Close this device.
 
size_t(* read )(struct wfio_device_t *dev, void *buf, size_t sz, size_t elem)
 Read from this device.
 
size_t(* write )(struct wfio_device_t *dev, const void *buf, size_t sz, size_t elem)
 Write to this device.
 
int(* seek )(struct wfio_device_t *dev, wfio_off_t offset, wfio_whence_t whence)
 Seek to a particular stream position in this device.
 
wfio_off_t(* tell )(struct wfio_device_t *dev)
 Obtain the current stream position for this device.
 
struct wfio_device_t *(* dup )(struct wfio_device_t *dev)
 Duplicate this device.
 
int(* flush )(struct wfio_device_t *dev)
 Flush the underlying buffer.
 
size_t(* setbufsz )(struct wfio_device_t *dev, size_t len)
 Ensure that the buffer is exactly len bytes long.
 
size_t(* getbufsz )(struct wfio_device_t *dev)
 Obtain the size of the buffer associated this device.
 
int(* dcntl )(struct wfio_device_t *dev, int cmd, va_list args)
 Perform device-independent control on this device.
 
int(* ioctl )(struct wfio_device_t *dev, int cmd, va_list args)
 Perform device-specific I/O control on the underlying device.
 

Detailed Description

The virtual table for a wfio_device_t.

This structure facilitates dynamic dispatch for a wfio_device_t. Each callback serves to service one the methods of the wfio_device_t and is assumed.

Precondition
Each entry in the vtable must point to a valid callback.
Postcondition
The corresponding callback will be invoked when a device's method is called.

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