diff options
Diffstat (limited to 'include/std/buffer.h')
-rw-r--r-- | include/std/buffer.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/std/buffer.h b/include/std/buffer.h index 3aad48b..7253d88 100644 --- a/include/std/buffer.h +++ b/include/std/buffer.h @@ -17,8 +17,13 @@ void tsl_buffer_init(TslBuffer *self); void tsl_buffer_deinit(TslBuffer *self); int tsl_buffer_append(TslBuffer *self, const void *data, size_t size); -/* The buffer has to >= @size */ -void tsl_buffer_pop(TslBuffer *self, size_t size); +/* + This function changes the size of the buffer without changing the capacity + and returns the value at the back of the buffer, which is valid until @tsl_buffer_append or + @tsl_buffer_deinit is called. + The buffer size has to be larger or equal to @size. +*/ +void* tsl_buffer_pop(TslBuffer *self, size_t size); void* tsl_buffer_begin(TslBuffer *self); void* tsl_buffer_end(TslBuffer *self); void tsl_buffer_move(TslBuffer *dst, TslBuffer *src); |