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 |