ucx/cx/buffer.h

changeset 2
fbdfaacc4182
parent 0
2483f517c562
--- a/ucx/cx/buffer.h	Mon Jan 22 17:27:47 2024 +0100
+++ b/ucx/cx/buffer.h	Sat Jan 27 17:50:19 2024 +0100
@@ -40,7 +40,6 @@
  *
  * \author Mike Becker
  * \author Olaf Wintermann
- * \version 3.0
  * \copyright 2-Clause BSD License
  */
 
@@ -312,18 +311,32 @@
  * Clears the buffer by resetting the position and deleting the data.
  *
  * The data is deleted by zeroing it with a call to memset().
+ * If you do not need that, you can use the faster cxBufferReset().
  *
  * @param buffer the buffer to be cleared
+ * @see cxBufferReset()
  */
 __attribute__((__nonnull__))
 void cxBufferClear(CxBuffer *buffer);
 
 /**
- * Tests, if the buffer position has exceeded the buffer capacity.
+ * Resets the buffer by resetting the position and size to zero.
+ *
+ * The data in the buffer is not deleted. If you need a safe
+ * reset of the buffer, use cxBufferClear().
+ *
+ * @param buffer the buffer to be cleared
+ * @see cxBufferClear()
+ */
+__attribute__((__nonnull__))
+void cxBufferReset(CxBuffer *buffer);
+
+/**
+ * Tests, if the buffer position has exceeded the buffer size.
  *
  * @param buffer the buffer to test
  * @return non-zero, if the current buffer position has exceeded the last
- * available byte of the buffer.
+ * byte of the buffer's contents.
  */
 __attribute__((__nonnull__))
 int cxBufferEof(CxBuffer const *buffer);

mercurial