16 /* if space is NULL, new space is allocated and the autofree flag is enforced */ |
17 /* if space is NULL, new space is allocated and the autofree flag is enforced */ |
17 UcxBuffer *ucx_buffer_new(void *space, size_t length, int flags); |
18 UcxBuffer *ucx_buffer_new(void *space, size_t length, int flags); |
18 void ucx_buffer_free(UcxBuffer* buffer); |
19 void ucx_buffer_free(UcxBuffer* buffer); |
19 |
20 |
20 /* |
21 /* |
|
22 * the autofree flag is enforced for the new buffer |
|
23 * if length is zero, the whole remaining buffer shall be extracted |
|
24 * the position of the new buffer is set to zero |
|
25 */ |
|
26 UcxBuffer *ucx_buffer_extract(UcxBuffer *src, |
|
27 size_t start, size_t length, int flags); |
|
28 #define ucx_buffer_clone(src,flags) \ |
|
29 ucx_buffer_extract(src, 0, 0, flags) |
|
30 |
|
31 /* |
21 * Moves the position of the buffer to a new position relative to whence. |
32 * Moves the position of the buffer to a new position relative to whence. |
22 * |
33 * |
23 * SEEK_SET marks the start of the buffer |
34 * SEEK_SET marks the start of the buffer |
24 * SEEK_CUR marks the current position |
35 * SEEK_CUR marks the current position |
25 * SEEK_END marks the first 0-byte in the buffer |
36 * SEEK_END marks the first 0-byte in the buffer |
29 * remains unchanged. |
40 * remains unchanged. |
30 * |
41 * |
31 */ |
42 */ |
32 int ucx_buffer_seek(UcxBuffer *buffer, off_t offset, int whence); |
43 int ucx_buffer_seek(UcxBuffer *buffer, off_t offset, int whence); |
33 size_t ucx_buffer_tell(UcxBuffer *buffer); |
44 size_t ucx_buffer_tell(UcxBuffer *buffer); |
|
45 size_t ucx_buffer_size(UcxBuffer *buffer); |
|
46 /* returns non-zero, if at least the specified flags are set */ |
|
47 int ucx_buffer_testflags(UcxBuffer *buffer, int flags); |
34 |
48 |
35 /* |
49 /* |
36 * returns non-zero, iff the current buffer position has exceeded the last |
50 * returns non-zero, iff the current buffer position has exceeded the last |
37 * available byte of the underlying buffer |
51 * available byte of the underlying buffer |
38 * |
52 * |