src/cx/buffer.h

changeset 567
f90a7cfe2480
parent 545
3700ac4bd9a3
child 628
1e2be40f0cb5
equal deleted inserted replaced
566:d3100c987a39 567:f90a7cfe2480
308 ); 308 );
309 309
310 /** 310 /**
311 * Writes data to a CxBuffer. 311 * Writes data to a CxBuffer.
312 * 312 *
313 * The position of the buffer is increased by the number of bytes written. 313 * If flushing is enabled and the buffer needs to flush, the data is flushed to
314 * the target until the target signals that it cannot take more data by
315 * returning zero via the respective write function. In that case, the remaining
316 * data in this buffer is shifted to the beginning of this buffer so that the
317 * newly available space can be used to append as much data as possible. This
318 * function only stops writing more elements, when the flush target and this
319 * buffer are both incapable of taking more data or all data has been written.
320 * The number returned by this function is the total number of elements that
321 * could be written during the process. It does not necessarily mean that those
322 * elements are still in this buffer, because some of them could have also be
323 * flushed already.
324 *
325 * If automatic flushing is not enabled, the position of the buffer is increased
326 * by the number of bytes written.
314 * 327 *
315 * \note The signature is compatible with the fwrite() family of functions. 328 * \note The signature is compatible with the fwrite() family of functions.
316 * 329 *
317 * @param ptr a pointer to the memory area containing the bytes to be written 330 * @param ptr a pointer to the memory area containing the bytes to be written
318 * @param size the length of one element 331 * @param size the length of one element

mercurial