NUGU SDK Linux  1.7.6
nugu_ringbuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 SK Telecom Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __NUGU_RING_BUFFER_H__
18 #define __NUGU_RING_BUFFER_H__
19 
20 #include <nugu.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
41 typedef struct _nugu_ring_buffer NuguRingBuffer;
42 
49 NUGU_API NuguRingBuffer *nugu_ring_buffer_new(int item_size, int max_items);
50 
56 
66 NUGU_API int nugu_ring_buffer_resize(NuguRingBuffer *buf, int item_size,
67  int max_items);
68 
78 NUGU_API int nugu_ring_buffer_push_data(NuguRingBuffer *buf, const char *data,
79  int size);
80 
90 NUGU_API int nugu_ring_buffer_read_item(NuguRingBuffer *buf, char *item,
91  int *size);
92 
101 
110 
119 
125 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif
NUGU_API int nugu_ring_buffer_get_count(NuguRingBuffer *buf)
Get count.
NUGU_API int nugu_ring_buffer_get_item_size(NuguRingBuffer *buf)
Get itemsize.
NUGU_API void nugu_ring_buffer_clear_items(NuguRingBuffer *buf)
Clear the ringbuffer.
NUGU_API int nugu_ring_buffer_get_maxcount(NuguRingBuffer *buf)
Get maxcount.
NUGU_API void nugu_ring_buffer_free(NuguRingBuffer *buf)
Destroy the ringbuffer object.
struct _nugu_ring_buffer NuguRingBuffer
RingBuffer object.
Definition: nugu_ringbuffer.h:41
NUGU_API int nugu_ring_buffer_resize(NuguRingBuffer *buf, int item_size, int max_items)
Resize the ringbuffer.
NUGU_API int nugu_ring_buffer_read_item(NuguRingBuffer *buf, char *item, int *size)
Read item from ringbuffer.
NUGU_API NuguRingBuffer * nugu_ring_buffer_new(int item_size, int max_items)
Create new ringbuffer object.
NUGU_API int nugu_ring_buffer_push_data(NuguRingBuffer *buf, const char *data, int size)
Push data to ringbuffer.