util/fifo_buffer: add method _init()
This commit is contained in:
parent
1e2018ce83
commit
4fa724461e
@ -58,6 +58,14 @@ fifo_buffer_new(size_t size)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fifo_buffer_init(struct fifo_buffer *buffer, size_t size)
|
||||||
|
{
|
||||||
|
buffer->size = size - (sizeof(*buffer) - sizeof(buffer->buffer));
|
||||||
|
buffer->start = 0;
|
||||||
|
buffer->end = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fifo_buffer_move(struct fifo_buffer *buffer);
|
fifo_buffer_move(struct fifo_buffer *buffer);
|
||||||
|
|
||||||
|
@ -60,6 +60,9 @@ extern "C" {
|
|||||||
struct fifo_buffer *
|
struct fifo_buffer *
|
||||||
fifo_buffer_new(size_t size);
|
fifo_buffer_new(size_t size);
|
||||||
|
|
||||||
|
void
|
||||||
|
fifo_buffer_init(struct fifo_buffer *buffer, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the capacity of the #fifo_buffer, while preserving existing
|
* Change the capacity of the #fifo_buffer, while preserving existing
|
||||||
* data.
|
* data.
|
||||||
|
Loading…
Reference in New Issue
Block a user