RingBuffer manipulation functions.
More...
RingBuffer manipulation functions.
The ring buffer manages items by setting the size and number of items as a basic unit.
◆ nugu_ring_buffer_new()
NUGU_API NuguRingBuffer* nugu_ring_buffer_new |
( |
int |
item_size, |
|
|
int |
max_items |
|
) |
| |
Create new ringbuffer object.
- Parameters
-
[in] | item_size | default item size |
[in] | max_items | count of items |
- Returns
- ringbuffer object
◆ nugu_ring_buffer_free()
Destroy the ringbuffer object.
- Parameters
-
◆ nugu_ring_buffer_resize()
NUGU_API int nugu_ring_buffer_resize |
( |
NuguRingBuffer * |
buf, |
|
|
int |
item_size, |
|
|
int |
max_items |
|
) |
| |
Resize the ringbuffer.
- Parameters
-
[in] | buf | ringbuffer object |
[in] | item_size | default item size |
[in] | max_items | count of items |
- Returns
- result
- Return values
-
◆ nugu_ring_buffer_push_data()
NUGU_API int nugu_ring_buffer_push_data |
( |
NuguRingBuffer * |
buf, |
|
|
const char * |
data, |
|
|
int |
size |
|
) |
| |
Push data to ringbuffer.
- Parameters
-
[in] | buf | ringbuffer object |
[in] | data | data |
[in] | size | size of data |
- Returns
- result
- Return values
-
◆ nugu_ring_buffer_read_item()
NUGU_API int nugu_ring_buffer_read_item |
( |
NuguRingBuffer * |
buf, |
|
|
char * |
item, |
|
|
int * |
size |
|
) |
| |
Read item from ringbuffer.
- Parameters
-
[in] | buf | ringbuffer object |
[out] | item | item |
[out] | size | size of item |
- Returns
- result
- Return values
-
◆ nugu_ring_buffer_get_count()
Get count.
- Parameters
-
- Returns
- result
- Return values
-
>0 | success (count) |
-1 | failure |
◆ nugu_ring_buffer_get_item_size()
Get itemsize.
- Parameters
-
- Returns
- result
- Return values
-
>0 | success (itemsize) |
-1 | failure |
◆ nugu_ring_buffer_get_maxcount()
Get maxcount.
- Parameters
-
- Returns
- result
- Return values
-
>0 | success (max count) |
-1 | failure |
◆ nugu_ring_buffer_clear_items()
Clear the ringbuffer.
- Parameters
-