size_t stream_write(stream_t *s, const void *buf, size_t n, stream_status_t *st);
Write up to n bytes from buf to the stream port.
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:
write callback stored in the stream handle.write callback.st != NULL, stores in *st the status produced by the underlying write 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_write() does not call the borrower-facing read, flush, or close callbacks.n == 0.stream_create().