size_t stream_read(stream_t *s, void *buf, size_t n, stream_status_t *st);
Read up to n bytes from the stream port into buf.
s != NULL, s must denote a valid stream_t handle created by stream_create().n == 0, the function returns 0.n == 0 and st != NULL, the function sets *st = STREAM_STATUS_OK.n == 0 case, no backend operation is performed.For n > 0:
s must not be NULL.buf must not be NULL.For n > 0, when s != NULL, buf != NULL, and s->backend != NULL:
read callback stored in the stream handle.read callback.st != NULL, stores in *st the status produced by the underlying read callback.For n > 0:
s == NULL, returns 0.st != NULL, sets *st = STREAM_STATUS_INVALID.buf == NULL, returns 0.st != NULL, sets *st = STREAM_STATUS_INVALID.s != NULL but s->backend == NULL, returns 0.st != NULL, sets *st = STREAM_STATUS_NO_BACKEND.st == NULL, status reporting is omitted.stream_read() does not call the adapter-facing write, flush, or close callbacks.n == 0.stream_create().