| 147 * |
147 * |
| 148 * @param buffer the buffer to initialize |
148 * @param buffer the buffer to initialize |
| 149 * @param space pointer to the memory area, or \c NULL to allocate |
149 * @param space pointer to the memory area, or \c NULL to allocate |
| 150 * new memory |
150 * new memory |
| 151 * @param capacity the capacity of the buffer |
151 * @param capacity the capacity of the buffer |
| 152 * @param allocator the allocator this buffer shall use for automatic memory management |
152 * @param allocator the allocator this buffer shall use for automatic |
| |
153 * memory management. If \c NULL, the default heap allocator will be used. |
| 153 * @param flags buffer features (see cx_buffer_s.flags) |
154 * @param flags buffer features (see cx_buffer_s.flags) |
| 154 * @return zero on success, non-zero if a required allocation failed |
155 * @return zero on success, non-zero if a required allocation failed |
| 155 */ |
156 */ |
| 156 __attribute__((__nonnull__(1, 4))) |
157 __attribute__((__nonnull__(1))) |
| 157 int cxBufferInit( |
158 int cxBufferInit( |
| 158 CxBuffer *buffer, |
159 CxBuffer *buffer, |
| 159 void *space, |
160 void *space, |
| 160 size_t capacity, |
161 size_t capacity, |
| 161 CxAllocator const *allocator, |
162 CxAllocator const *allocator, |