![]() |
ucx
UAP Common Extensions
|
Utility functions for data streams. More...
#include "common.h"Go to the source code of this file.
Macros | |
| #define | cx_stream_bcopy(src, dest, rfnc, wfnc, buf, bufsize) |
| Reads data from a stream and writes it to another stream. | |
| #define | cx_stream_copy(src, dest, rfnc, wfnc) |
| Reads data from a stream and writes it to another stream. | |
Functions | |
| size_t | cx_stream_bncopy (void *src, void *dest, cx_read_func rfnc, cx_write_func wfnc, char *buf, size_t bufsize, size_t n) |
| Reads data from a stream and writes it to another stream. | |
| size_t | cx_stream_ncopy (void *src, void *dest, cx_read_func rfnc, cx_write_func wfnc, size_t n) |
| Reads data from a stream and writes it to another stream. | |
Utility functions for data streams.
| #define cx_stream_bcopy | ( | src, | |
| dest, | |||
| rfnc, | |||
| wfnc, | |||
| buf, | |||
| bufsize ) |
Reads data from a stream and writes it to another stream.
| src | (void*) the source stream |
| dest | (void*) the destination stream |
| rfnc | (cx_read_func) the read function |
| wfnc | (cx_write_func) the write function |
| buf | (char*) a pointer to the copy buffer or NULL if a buffer shall be implicitly created on the heap |
| bufsize | (size_t) the size of the copy buffer - if buf is NULL, you can set this to zero to let the implementation decide |
| #define cx_stream_copy | ( | src, | |
| dest, | |||
| rfnc, | |||
| wfnc ) |
Reads data from a stream and writes it to another stream.
The data is temporarily stored in a stack-allocated buffer.
| src | (void*) the source stream |
| dest | (void*) the destination stream |
| rfnc | (cx_read_func) the read function |
| wfnc | (cx_write_func) the write function |
| size_t cx_stream_bncopy | ( | void * | src, |
| void * | dest, | ||
| cx_read_func | rfnc, | ||
| cx_write_func | wfnc, | ||
| char * | buf, | ||
| size_t | bufsize, | ||
| size_t | n ) |
Reads data from a stream and writes it to another stream.
| src | the source stream |
| dest | the destination stream |
| rfnc | the read function |
| wfnc | the write function |
| buf | a pointer to the copy buffer or NULL if a buffer shall be implicitly created on the heap |
| bufsize | the size of the copy buffer - if buf is NULL, you can set this to zero to let the implementation decide |
| n | the maximum number of bytes that shall be copied. If this is larger than bufsize, the content is copied over multiple iterations. |
| size_t cx_stream_ncopy | ( | void * | src, |
| void * | dest, | ||
| cx_read_func | rfnc, | ||
| cx_write_func | wfnc, | ||
| size_t | n ) |
Reads data from a stream and writes it to another stream.
The data is temporarily stored in a stack-allocated buffer.
| src | the source stream |
| dest | the destination stream |
| rfnc | the read function |
| wfnc | the write function |
| n | the maximum number of bytes that shall be copied. |