17 #ifndef __NUGU_BUFFER_H__
18 #define __NUGU_BUFFER_H__
47 #define NUGU_BUFFER_NOT_FOUND ((size_t) - 1)
struct _nugu_buffer NuguBuffer
Buffer object.
Definition: nugu_buffer.h:52
NUGU_API size_t nugu_buffer_add(NuguBuffer *buf, const void *data, size_t data_len)
Append the data to buffer object.
NUGU_API int nugu_buffer_set_byte(NuguBuffer *buf, size_t pos, unsigned char byte)
Append the data to buffer object.
NUGU_API size_t nugu_buffer_get_alloc_size(NuguBuffer *buf)
Gets the size of the entire data allocated for the buffer.
NUGU_API int nugu_buffer_shift_left(NuguBuffer *buf, size_t size)
Delete a certain amount of data and move the remaining data forward.
NUGU_API const void * nugu_buffer_peek(NuguBuffer *buf)
Get the internal buffer.
NUGU_API int nugu_buffer_clear_from(NuguBuffer *buf, size_t pos)
Clear data from a specific position to the end.
NUGU_API void * nugu_buffer_pop(NuguBuffer *buf, size_t size)
Extract data by a certain size.
NUGU_API size_t nugu_buffer_add_byte(NuguBuffer *buf, unsigned char byte)
Append the data to buffer object.
NUGU_API void * nugu_buffer_free(NuguBuffer *buf, int is_data_free)
Destroy the buffer object.
NUGU_API NuguBuffer * nugu_buffer_new(size_t default_size)
Create new buffer object.
NUGU_API unsigned char nugu_buffer_peek_byte(NuguBuffer *buf, size_t pos)
Get data at a specific position.
NUGU_API size_t nugu_buffer_get_size(NuguBuffer *buf)
Gets the size of the entire data added to the buffer.
NUGU_API size_t nugu_buffer_find_byte(NuguBuffer *buf, unsigned char want)
Get the position of the data you want to find.
NUGU_API int nugu_buffer_clear(NuguBuffer *buf)
Clear the buffer.