src/cx/buffer.h

changeset 567
f90a7cfe2480
parent 545
3700ac4bd9a3
child 628
1e2be40f0cb5
     1.1 --- a/src/cx/buffer.h	Mon Jul 25 14:16:49 2022 +0200
     1.2 +++ b/src/cx/buffer.h	Mon Jul 25 15:29:56 2022 +0200
     1.3 @@ -310,7 +310,20 @@
     1.4  /**
     1.5   * Writes data to a CxBuffer.
     1.6   *
     1.7 - * The position of the buffer is increased by the number of bytes written.
     1.8 + * If flushing is enabled and the buffer needs to flush, the data is flushed to
     1.9 + * the target until the target signals that it cannot take more data by
    1.10 + * returning zero via the respective write function. In that case, the remaining
    1.11 + * data in this buffer is shifted to the beginning of this buffer so that the
    1.12 + * newly available space can be used to append as much data as possible. This
    1.13 + * function only stops writing more elements, when the flush target and this
    1.14 + * buffer are both incapable of taking more data or all data has been written.
    1.15 + * The number returned by this function is the total number of elements that
    1.16 + * could be written during the process. It does not necessarily mean that those
    1.17 + * elements are still in this buffer, because some of them could have also be
    1.18 + * flushed already.
    1.19 + *
    1.20 + * If automatic flushing is not enabled, the position of the buffer is increased
    1.21 + * by the number of bytes written.
    1.22   *
    1.23   * \note The signature is compatible with the fwrite() family of functions.
    1.24   *

mercurial