Boron 0.1.0

UPortDevice Struct Reference

The UPortDevice struct holds methods for a class of input/ouput device. More...


Data Fields

int(* open )(UThread *, const UPortDevice *, const UCell *from, int opt, UCell *res)
 Create and open a new port.
void(* close )(UBuffer *)
 Close port.
int(* read )(UThread *, UBuffer *, UCell *, int part)
 Read data from port.
int(* write )(UThread *, UBuffer *, const UCell *)
 Write data to port.
int(* seek )(UThread *, UBuffer *, UCell *, int where)
 Seek to position.

Detailed Description

The UPortDevice struct holds methods for a class of input/ouput device.


Field Documentation

int(* UPortDevice::open)(UThread *, const UPortDevice *pdev, const UCell *from, int opt, UCell *res)

Create and open a new port.

Parameters:
pdev This device class.
from Specification of port.
opt Port options.
res Cell for new port.
Returns:
UR_OK/UR_THROW.
Open will normally call boron_makePort() to generate a port buffer and set res.

void(* UPortDevice::close)(UBuffer *pbuf)

Close port.

Parameters:
pbuf Buffer created by UPortDevice::open.

int(* UPortDevice::read)(UThread *, UBuffer *pbuf, UCell *dest, int part)

Read data from port.

Parameters:
pbuf Buffer created by UPortDevice::open.
dest Destination buffer.
part If greater than zero, then limit read to this number of bytes.
Returns:
UR_OK/UR_THROW

int(* UPortDevice::write)(UThread *, UBuffer *pbuf, const UCell *data)

Write data to port.

Parameters:
pbuf Buffer created by UPortDevice::open.
data Data to write.
Returns:
UR_OK/UR_THROW

int(* UPortDevice::seek)(UThread *, UBuffer *pbuf, UCell *pos, int where)

Seek to position.

Parameters:
pbuf Buffer created by UPortDevice::open.
pos New position relative to where.
where SEEK_SET, SEEK_END, or SEEK_CUR.
Returns:
UR_OK/UR_THROW
If the device cannot seek then call ur_error().


The documentation for this struct was generated from the following files:
Generated on 27 Jan 2012 by Doxygen 1.5.1