1.1 --- a/src/cx/buffer.h Mon Dec 18 14:25:10 2023 +0100 1.2 +++ b/src/cx/buffer.h Mon Dec 18 15:13:26 2023 +0100 1.3 @@ -311,13 +311,27 @@ 1.4 * Clears the buffer by resetting the position and deleting the data. 1.5 * 1.6 * The data is deleted by zeroing it with a call to memset(). 1.7 + * If you do not need that, you can use the faster cxBufferReset(). 1.8 * 1.9 * @param buffer the buffer to be cleared 1.10 + * @see cxBufferReset() 1.11 */ 1.12 __attribute__((__nonnull__)) 1.13 void cxBufferClear(CxBuffer *buffer); 1.14 1.15 /** 1.16 + * Resets the buffer by resetting the position and size to zero. 1.17 + * 1.18 + * The data in the buffer is not deleted. If you need a safe 1.19 + * reset of the buffer, use cxBufferClear(). 1.20 + * 1.21 + * @param buffer the buffer to be cleared 1.22 + * @see cxBufferClear() 1.23 + */ 1.24 +__attribute__((__nonnull__)) 1.25 +void cxBufferReset(CxBuffer *buffer); 1.26 + 1.27 +/** 1.28 * Tests, if the buffer position has exceeded the buffer size. 1.29 * 1.30 * @param buffer the buffer to test