src/cx/buffer.h

changeset 1514
ee5d668a71e4
parent 1426
3a89b31f0724
child 1515
f024313c08f1
equal deleted inserted replaced
1513:4d641c6a2f82 1514:ee5d668a71e4
116 */ 116 */
117 size_t blksize; 117 size_t blksize;
118 /** 118 /**
119 * The maximum number of blocks to flush in one cycle. 119 * The maximum number of blocks to flush in one cycle.
120 * 120 *
121 * @attention while it is guaranteed that cxBufferFlush() will not flush 121 * @attention While it is guaranteed that cxBufferFlush() will not flush
122 * more blocks, this is not necessarily the case for cxBufferWrite(). 122 * more blocks, this is not necessarily the case for cxBufferWrite().
123 * After performing a flush cycle, cxBufferWrite() will retry the write 123 * After performing a flush cycle, cxBufferWrite() will retry the write
124 * operation and potentially trigger another flush cycle, until the 124 * operation and potentially trigger another flush cycle, until the
125 * flush target accepts no more data. 125 * flush target accepts no more data.
126 */ 126 */
386 */ 386 */
387 cx_attr_nonnull 387 cx_attr_nonnull
388 CX_EXPORT int cxBufferSeek(CxBuffer *buffer, off_t offset, int whence); 388 CX_EXPORT int cxBufferSeek(CxBuffer *buffer, off_t offset, int whence);
389 389
390 /** 390 /**
391 * Discards items from the end of the buffer.
392 *
393 * When the current position points to a byte that gets discarded,
394 * the position is set to the buffer size.
395 *
396 * @param buffer the buffer
397 * @param size the size of one item
398 * @param nitems the number of items to discard
399 * @return the actual number of discarded items
400 */
401 cx_attr_nonnull
402 CX_EXPORT size_t cxBufferPop(CxBuffer *buffer, size_t size, size_t nitems);
403
404 /**
391 * Clears the buffer by resetting the position and deleting the data. 405 * Clears the buffer by resetting the position and deleting the data.
392 * 406 *
393 * The data is deleted by zeroing it with a call to memset(). 407 * The data is deleted by zeroing it with a call to memset().
394 * If you do not need that, you can use the faster cxBufferReset(). 408 * If you do not need that, you can use the faster cxBufferReset().
395 * 409 *

mercurial