Fri, 17 Oct 2025 21:03:11 +0200
minor wording improvements in buffer documentation
docs/Writerside/topics/buffer.h.md | file | annotate | diff | comparison | revisions |
--- a/docs/Writerside/topics/buffer.h.md Fri Oct 17 16:53:24 2025 +0200 +++ b/docs/Writerside/topics/buffer.h.md Fri Oct 17 21:03:11 2025 +0200 @@ -266,7 +266,7 @@ It also adjusts the current position within the buffer, and in the case of a right shift also the size, by the same offset. Data shifted to the left is always discarded when the new position of a byte would be smaller than zero. -If the new position would be smaller than zero, it is set exactly to zero. +When bytes are discarded, the new position of the buffer is set to zero. When data is shift to the right, the behavior depends on the `CX_BUFFER_AUTO_EXTEND` flag. If set, the function extends the buffer's capacity before moving the data. @@ -308,7 +308,7 @@ > and starts flushing only when that threshold is exceeded. Flushing happens by invoking the `wfunc` up to `blkmax` times, writing up to `blksize` bytes from the buffer to the `target` with each call. -The target might not accept all bytes (i.e. the `wfunc` return value indicates that fewer items have been written than requested), +The target might not accept all bytes (i.e., the `wfunc` return value indicates that fewer items have been written than requested), in which case the remaining data remains in the buffer. That means the buffer is effectively [shifted](#shift-contents) left by the number of successfully flushed bytes. @@ -317,7 +317,7 @@ > is not enough, another flush may be triggered within the same invocation of the write operation. > > That means as much data is written to the buffer and/or flushed as possible, until neither the flush target nor the buffer accept more data. ->{style="note"} +> {style="note"} > The function `cxBufferFlush()` simply returns zero when flushing was not enabled via `cxBufferEnableFlushing()`.