diff -r 3dc9075df822 -r eb9e7bd40a8e src/cx/buffer.h --- a/src/cx/buffer.h Sat Jan 29 14:32:04 2022 +0100 +++ b/src/cx/buffer.h Sun Jan 30 14:19:00 2022 +0100 @@ -100,7 +100,7 @@ /** * UCX buffer. */ -typedef cx_buffer_s *CxBuffer; +typedef cx_buffer_s CxBuffer; /** * Creates a new buffer. @@ -115,7 +115,7 @@ * @param flags buffer features (see cx_buffer_s.flags) * @return the new buffer */ -CxBuffer cxBufferCreate( +CxBuffer *cxBufferCreate( void *space, size_t capacity, int flags @@ -129,7 +129,7 @@ * * @param buffer the buffer to destroy */ -void cxBufferDestroy(CxBuffer buffer); +void cxBufferDestroy(CxBuffer *buffer); /** * Creates a new buffer and fills it with content copied from another buffer. @@ -142,8 +142,8 @@ * @param flags features for the new buffer (#CX_BUFFER_FREE_CONTENTS will always be enabled) * @return a new buffer containing the extraction */ -CxBuffer cxBufferExtract( - CxBuffer src, +CxBuffer *cxBufferExtract( + CxBuffer *src, size_t start, size_t length, int flags @@ -193,7 +193,7 @@ * @return 0 on success, non-zero if a required auto-extension fails */ int cxBufferShift( - CxBuffer buffer, + CxBuffer *buffer, off_t shift ); @@ -207,7 +207,7 @@ * @see cxBufferShift() */ int cxBufferShiftRight( - CxBuffer buffer, + CxBuffer *buffer, size_t shift ); @@ -224,7 +224,7 @@ * @see cxBufferShift() */ int cxBufferShiftLeft( - CxBuffer buffer, + CxBuffer *buffer, size_t shift ); @@ -249,7 +249,7 @@ * */ int cxBufferSeek( - CxBuffer buffer, + CxBuffer *buffer, off_t offset, int whence ); @@ -271,7 +271,7 @@ * @return non-zero, if the current buffer position has exceeded the last * available byte of the buffer. */ -int cxBufferEof(CxBuffer buffer); +int cxBufferEof(CxBuffer *buffer); /** @@ -284,7 +284,7 @@ * @return 0 on success or a non-zero value on failure */ int cxBufferMinimumCapacity( - CxBuffer buffer, + CxBuffer *buffer, size_t capacity ); @@ -305,7 +305,7 @@ void const *ptr, size_t size, size_t nitems, - CxBuffer buffer + CxBuffer *buffer ); /** @@ -325,7 +325,7 @@ void *ptr, size_t size, size_t nitems, - CxBuffer buffer + CxBuffer *buffer ); /** @@ -344,7 +344,7 @@ * reached and automatic extension is not enabled or not possible */ int cxBufferPut( - CxBuffer buffer, + CxBuffer *buffer, int c ); @@ -356,7 +356,7 @@ * @param buffer the buffer to read from * @return the character or \c EOF, if the end of the buffer is reached */ -int cxBufferGet(CxBuffer buffer); +int cxBufferGet(CxBuffer *buffer); /** * Writes a string to a buffer. @@ -366,7 +366,7 @@ * @return the number of bytes written */ size_t cxBufferPutString( - CxBuffer buffer, + CxBuffer *buffer, const char *str );