Borrower-facing runtime operations for the stream port.
More...


Go to the source code of this file.
Functions | |
| size_t | stream_read (stream_t *s, void *buf, size_t n, stream_status_t *st) |
| Read bytes from a stream. | |
| size_t | stream_write (stream_t *s, const void *buf, size_t n, stream_status_t *st) |
| Write bytes to a stream. | |
| stream_status_t | stream_flush (stream_t *s) |
| Flush a stream. | |
This header exposes the public runtime operations used to interact with a borrowed stream_t handle.
Definition in file stream.h.
| stream_status_t stream_flush | ( | stream_t * | s | ) |
| size_t stream_read | ( | stream_t * | s, |
| void * | buf, | ||
| size_t | n, | ||
| stream_status_t * | st | ||
| ) |
| [in] | s | Stream handle to read from. |
| [out] | buf | Destination buffer receiving up to n bytes. |
| [in] | n | Maximum number of bytes to read. |
| [out] | st | Optional status output. |
This function exposes the borrower-facing read operation of the stream port.
If n == 0, the function returns 0 and, when st != NULL, reports STREAM_STATUS_OK.
| size_t stream_write | ( | stream_t * | s, |
| const void * | buf, | ||
| size_t | n, | ||
| stream_status_t * | st | ||
| ) |
| [in] | s | Stream handle to write to. |
| [in] | buf | Source buffer containing up to n bytes to write. |
| [in] | n | Maximum number of bytes to write. |
| [out] | st | Optional status output. |
This function exposes the borrower-facing write operation of the stream port.
If n == 0, the function returns 0 and, when st != NULL, reports STREAM_STATUS_OK.