CO_STREAM_WRITE


 co_error co_stream_write(co_stream stream,                          const void *buffer,                          size_t buffersize); 

Header File

co.h

Description

This function writes a data packet to a previously opened stream. This function must be called from within a process run function.

Arguments

The arguments for co_stream_write are as follows:

co_stream stream

A pointer to a stream as passed on the process argument list.

const void *buffer

A pointer to the source data. The source is typically a local variable or array element.

size_t buffersize

The size of the source buffer in bytes. This number must be at least as large as the stream's packet width (in bytes), as specified by co_stream_create.


Return Value

Possible return values are listed, with the resulting value of co_errno shown in parentheses:

co_err_none

Success (CO_ENOERROR).

co_err_eos

Encountered an end-of-stream token (CO_EEOS).

co_err_invalid_arg

The stream argument is NULL (CO_ENULL_PTR) or the buffersize argument is smaller than the stream's packet width in bytes (CO_EINVALID_STREAM_WIDTH).

co_err_not_open

The stream is not open for write (CO_ENOT_OPEN).


Notes

The co_stream_write function must be used only on streams that have been opened with mode O_WRONLY.

The co_stream_write function blocks (waits) if the output stream is already full.



    Practical FPGA Programming in C
    Practical FPGA Programming in C
    ISBN: 0131543180
    EAN: 2147483647
    Year: 2005
    Pages: 208

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net