ucx/cx/buffer.h

branch
newapi
changeset 253
087cc9216f28
parent 174
0358f1d9c506
equal deleted inserted replaced
252:7d176764756d 253:087cc9216f28
38 * can be enabled. See the documentation of the macro constants for more 38 * can be enabled. See the documentation of the macro constants for more
39 * information. 39 * information.
40 * 40 *
41 * \author Mike Becker 41 * \author Mike Becker
42 * \author Olaf Wintermann 42 * \author Olaf Wintermann
43 * \version 3.0
44 * \copyright 2-Clause BSD License 43 * \copyright 2-Clause BSD License
45 */ 44 */
46 45
47 #ifndef UCX_BUFFER_H 46 #ifndef UCX_BUFFER_H
48 #define UCX_BUFFER_H 47 #define UCX_BUFFER_H
310 309
311 /** 310 /**
312 * Clears the buffer by resetting the position and deleting the data. 311 * Clears the buffer by resetting the position and deleting the data.
313 * 312 *
314 * The data is deleted by zeroing it with a call to memset(). 313 * The data is deleted by zeroing it with a call to memset().
314 * If you do not need that, you can use the faster cxBufferReset().
315 * 315 *
316 * @param buffer the buffer to be cleared 316 * @param buffer the buffer to be cleared
317 * @see cxBufferReset()
317 */ 318 */
318 __attribute__((__nonnull__)) 319 __attribute__((__nonnull__))
319 void cxBufferClear(CxBuffer *buffer); 320 void cxBufferClear(CxBuffer *buffer);
320 321
321 /** 322 /**
322 * Tests, if the buffer position has exceeded the buffer capacity. 323 * Resets the buffer by resetting the position and size to zero.
324 *
325 * The data in the buffer is not deleted. If you need a safe
326 * reset of the buffer, use cxBufferClear().
327 *
328 * @param buffer the buffer to be cleared
329 * @see cxBufferClear()
330 */
331 __attribute__((__nonnull__))
332 void cxBufferReset(CxBuffer *buffer);
333
334 /**
335 * Tests, if the buffer position has exceeded the buffer size.
323 * 336 *
324 * @param buffer the buffer to test 337 * @param buffer the buffer to test
325 * @return non-zero, if the current buffer position has exceeded the last 338 * @return non-zero, if the current buffer position has exceeded the last
326 * available byte of the buffer. 339 * byte of the buffer's contents.
327 */ 340 */
328 __attribute__((__nonnull__)) 341 __attribute__((__nonnull__))
329 int cxBufferEof(CxBuffer const *buffer); 342 int cxBufferEof(CxBuffer const *buffer);
330 343
331 344

mercurial