1.1 --- a/src/cx/buffer.h Sat Jan 29 14:32:04 2022 +0100 1.2 +++ b/src/cx/buffer.h Sun Jan 30 14:19:00 2022 +0100 1.3 @@ -100,7 +100,7 @@ 1.4 /** 1.5 * UCX buffer. 1.6 */ 1.7 -typedef cx_buffer_s *CxBuffer; 1.8 +typedef cx_buffer_s CxBuffer; 1.9 1.10 /** 1.11 * Creates a new buffer. 1.12 @@ -115,7 +115,7 @@ 1.13 * @param flags buffer features (see cx_buffer_s.flags) 1.14 * @return the new buffer 1.15 */ 1.16 -CxBuffer cxBufferCreate( 1.17 +CxBuffer *cxBufferCreate( 1.18 void *space, 1.19 size_t capacity, 1.20 int flags 1.21 @@ -129,7 +129,7 @@ 1.22 * 1.23 * @param buffer the buffer to destroy 1.24 */ 1.25 -void cxBufferDestroy(CxBuffer buffer); 1.26 +void cxBufferDestroy(CxBuffer *buffer); 1.27 1.28 /** 1.29 * Creates a new buffer and fills it with content copied from another buffer. 1.30 @@ -142,8 +142,8 @@ 1.31 * @param flags features for the new buffer (#CX_BUFFER_FREE_CONTENTS will always be enabled) 1.32 * @return a new buffer containing the extraction 1.33 */ 1.34 -CxBuffer cxBufferExtract( 1.35 - CxBuffer src, 1.36 +CxBuffer *cxBufferExtract( 1.37 + CxBuffer *src, 1.38 size_t start, 1.39 size_t length, 1.40 int flags 1.41 @@ -193,7 +193,7 @@ 1.42 * @return 0 on success, non-zero if a required auto-extension fails 1.43 */ 1.44 int cxBufferShift( 1.45 - CxBuffer buffer, 1.46 + CxBuffer *buffer, 1.47 off_t shift 1.48 ); 1.49 1.50 @@ -207,7 +207,7 @@ 1.51 * @see cxBufferShift() 1.52 */ 1.53 int cxBufferShiftRight( 1.54 - CxBuffer buffer, 1.55 + CxBuffer *buffer, 1.56 size_t shift 1.57 ); 1.58 1.59 @@ -224,7 +224,7 @@ 1.60 * @see cxBufferShift() 1.61 */ 1.62 int cxBufferShiftLeft( 1.63 - CxBuffer buffer, 1.64 + CxBuffer *buffer, 1.65 size_t shift 1.66 ); 1.67 1.68 @@ -249,7 +249,7 @@ 1.69 * 1.70 */ 1.71 int cxBufferSeek( 1.72 - CxBuffer buffer, 1.73 + CxBuffer *buffer, 1.74 off_t offset, 1.75 int whence 1.76 ); 1.77 @@ -271,7 +271,7 @@ 1.78 * @return non-zero, if the current buffer position has exceeded the last 1.79 * available byte of the buffer. 1.80 */ 1.81 -int cxBufferEof(CxBuffer buffer); 1.82 +int cxBufferEof(CxBuffer *buffer); 1.83 1.84 1.85 /** 1.86 @@ -284,7 +284,7 @@ 1.87 * @return 0 on success or a non-zero value on failure 1.88 */ 1.89 int cxBufferMinimumCapacity( 1.90 - CxBuffer buffer, 1.91 + CxBuffer *buffer, 1.92 size_t capacity 1.93 ); 1.94 1.95 @@ -305,7 +305,7 @@ 1.96 void const *ptr, 1.97 size_t size, 1.98 size_t nitems, 1.99 - CxBuffer buffer 1.100 + CxBuffer *buffer 1.101 ); 1.102 1.103 /** 1.104 @@ -325,7 +325,7 @@ 1.105 void *ptr, 1.106 size_t size, 1.107 size_t nitems, 1.108 - CxBuffer buffer 1.109 + CxBuffer *buffer 1.110 ); 1.111 1.112 /** 1.113 @@ -344,7 +344,7 @@ 1.114 * reached and automatic extension is not enabled or not possible 1.115 */ 1.116 int cxBufferPut( 1.117 - CxBuffer buffer, 1.118 + CxBuffer *buffer, 1.119 int c 1.120 ); 1.121 1.122 @@ -356,7 +356,7 @@ 1.123 * @param buffer the buffer to read from 1.124 * @return the character or \c EOF, if the end of the buffer is reached 1.125 */ 1.126 -int cxBufferGet(CxBuffer buffer); 1.127 +int cxBufferGet(CxBuffer *buffer); 1.128 1.129 /** 1.130 * Writes a string to a buffer. 1.131 @@ -366,7 +366,7 @@ 1.132 * @return the number of bytes written 1.133 */ 1.134 size_t cxBufferPutString( 1.135 - CxBuffer buffer, 1.136 + CxBuffer *buffer, 1.137 const char *str 1.138 ); 1.139